pytorch/caffe2/onnx/backend_rep.cc
Sebastian Messmer 643ca5def2 Replace c10::guts::stuff with std::stuff (#30915)
Summary:
Pull Request resolved: https://github.com/pytorch/pytorch/pull/30915

Since we now have C++14, we don't need these c10::guts helpers anymore
ghstack-source-id: 95777609

Test Plan: waitforsandcastle

Differential Revision: D18869639

fbshipit-source-id: 97716f932297c64c6e814410ac47b444c33d4e2e
2019-12-16 13:57:19 -08:00

32 lines
700 B
C++

#include "caffe2/core/common.h"
#include "caffe2/onnx/backend_rep.h"
#include <iostream>
namespace caffe2 { namespace onnx {
void Caffe2BackendRep::CheckInit() {
if (!predictor_) {
predictor_ = std::make_unique<caffe2::Predictor>(
makePredictorConfig(init_net_, pred_net_));
init_net_.Clear();
pred_net_.Clear();
}
}
void Caffe2BackendRep::Run(
const caffe2::Predictor::TensorList& inputs,
caffe2::Predictor::TensorList* outputs) {
CheckInit();
(*predictor_)(inputs, outputs);
}
void Caffe2BackendRep::RunMap(
const caffe2::Predictor::TensorMap& inputs,
caffe2::Predictor::TensorList* outputs) {
CheckInit();
(*predictor_)(inputs, outputs);
}
}}