1 #include "caffe2/core/common.h" 7 : Annotation(AnnotationKind::Onnx), Device(device) {}
9 void setDevice(std::string device) { Device = device; }
10 const std::string getDevice()
const {
return Device; }
12 void setOperatorDef(caffe2::OperatorDef* opDef) {
15 const caffe2::OperatorDef* getOperatorDef()
const {
16 assert(OpDef &&
"OperatorDef was never set. Use OnnxAnnotation::setOperatorDef.");
19 caffe2::OperatorDef* getMutableOperatorDef() {
20 assert(OpDef &&
"OperatorDef was never set. Use OnnxAnnotation::setOperatorDef.");
24 static bool classof(
const Annotation *
A) {
25 return A->getKind() == AnnotationKind::Onnx;
29 std::string Device =
"";
30 caffe2::OperatorDef* OpDef =
nullptr;
33 CAFFE2_API
nom::repr::NNModule convertToNNModule(caffe2::NetDef &net, std::unordered_map<std::string, nom::repr::NNGraph::NodeRef>* blobMapOut =
nullptr);
37 CAFFE2_API std::unique_ptr<nom::repr::NeuralNetOperator> convertToOperatorDef(caffe2::OperatorDef op);
Annotations allow for generic manipulation of neural network operations.