Caffe2 - C++ API
A deep learning, cross platform ML framework
file_adapter.h
1 #pragma once
2 
3 #include <fstream>
4 #include <memory>
5 
6 #include "c10/macros/Macros.h"
7 #include "caffe2/serialize/istream_adapter.h"
8 #include "caffe2/serialize/read_adapter_interface.h"
9 
10 namespace caffe2 {
11 namespace serialize {
12 
13 class CAFFE2_API FileAdapter final : public ReadAdapterInterface {
14  public:
15  C10_DISABLE_COPY_AND_ASSIGN(FileAdapter);
16  explicit FileAdapter(const std::string& file_name);
17  size_t size() const override;
18  size_t read(uint64_t pos, void* buf, size_t n, const char* what = "")
19  const override;
20  ~FileAdapter();
21 
22  private:
23  std::ifstream file_stream_;
24  std::unique_ptr<IStreamAdapter> istream_adapter_;
25 };
26 
27 } // namespace serialize
28 } // namespace caffe2
A global dictionary that holds information about what Caffe2 modules have been loaded in the current ...
Definition: blob.h:13