3 #include "caffe2/core/common.h" 4 #include "caffe2/core/workspace.h" 5 #include "caffe2/opt/bound_shape_inferencer.h" 6 #include "caffe2/proto/caffe2_pb.h" 9 #include <unordered_map> 14 constexpr
char kNetPos[] =
"net_pos";
15 constexpr
char kModelId[] =
"model_id";
25 const std::unordered_map<std::string, std::string>& input_mapping()
const {
26 return input_mapping_;
29 const std::unordered_map<std::string, std::string>& reverse_input_mapping()
31 return reverse_input_mapping_;
34 virtual void transform(
37 const std::vector<std::string>& weight_names,
38 const std::unordered_map<std::string, TensorShape>& shape_hints,
39 const std::unordered_set<int>& blacklisted_ops) = 0;
43 std::string getModelId(
const NetDef& net);
46 std::unordered_map<std::string, TensorShape> ssaRewriteAndMapNames(
49 const std::unordered_map<std::string, TensorShape>& input_shape_hints);
52 TensorProto wrapShapeInfoIntoTensorProto(
53 const std::string& name,
57 ShapeInfoMap inferShapes(
60 const std::unordered_map<std::string, TensorShape>& shape_hints_mapped,
64 std::unordered_map<std::string, std::string> input_mapping_;
67 std::unordered_map<std::string, std::string> reverse_input_mapping_;
Workspace is a class that holds all the related objects created during runtime: (1) all blobs...
A global dictionary that holds information about what Caffe2 modules have been loaded in the current ...