Caffe2 - C++ API
A deep learning, cross platform ML framework
backend_rep.cc
1 #include "caffe2/core/common.h"
2 #include "caffe2/onnx/backend_rep.h"
3 
4 #include <iostream>
5 
6 namespace caffe2 { namespace onnx {
7 
8 void Caffe2BackendRep::CheckInit() {
9  if (!predictor_) {
10  predictor_ = caffe2::make_unique<caffe2::Predictor>(
11  makePredictorConfig(init_net_, pred_net_));
12  init_net_.Clear();
13  pred_net_.Clear();
14  }
15 }
16 
17 void Caffe2BackendRep::Run(
18  const caffe2::Predictor::TensorList& inputs,
19  caffe2::Predictor::TensorList* outputs) {
20  CheckInit();
21  (*predictor_)(inputs, outputs);
22 }
23 
24 void Caffe2BackendRep::RunMap(
25  const caffe2::Predictor::TensorMap& inputs,
26  caffe2::Predictor::TensorList* outputs) {
27  CheckInit();
28  (*predictor_)(inputs, outputs);
29 }
30 
31 }}
A global dictionary that holds information about what Caffe2 modules have been loaded in the current ...
Definition: blob.h:13