Caffe2 - C++ API
A deep learning, cross platform ML framework
backend_rep.h
1 #pragma once
2 
3 #include "caffe2/predictor/predictor.h"
4 #include "caffe2/proto/caffe2_pb.h"
5 
6 #include <memory>
7 #include <string>
8 #include <vector>
9 
10 namespace caffe2 { namespace onnx {
11 class CAFFE2_API Caffe2BackendRep {
12  public:
13  void Run(
14  const caffe2::Predictor::TensorList& inputs,
15  caffe2::Predictor::TensorList* outputs);
16  void RunMap(
17  const caffe2::Predictor::TensorMap& inputs,
18  caffe2::Predictor::TensorList* outputs);
19 
20  caffe2::NetDef& init_net() {
21  return init_net_;
22  }
23  caffe2::NetDef& pred_net() {
24  return pred_net_;
25  }
26  std::vector<std::string>& uninitialized_inputs() {
27  return uninitialized_inputs_;
28  }
29 
30  const caffe2::NetDef& init_net() const {
31  return init_net_;
32  }
33  const caffe2::NetDef& pred_net() const {
34  return pred_net_;
35  }
36  const std::vector<std::string>& uninitialized_inputs() const {
37  return uninitialized_inputs_;
38  }
39 
40  private:
41  void CheckInit();
42 
43  caffe2::NetDef init_net_;
44  caffe2::NetDef pred_net_;
45  std::vector<std::string> uninitialized_inputs_;
46  std::unique_ptr<caffe2::Predictor> predictor_{nullptr};
47 };
48 }}
A global dictionary that holds information about what Caffe2 modules have been loaded in the current ...
Definition: blob.h:13