set_target_properties(moco_tf_proto PROPERTIES POSITION_INDEPENDENT_CODE ON)
target_include_directories(moco_tf_proto PUBLIC ${GRAPHDEF_PROTO_INCLUDE_DIRS})
target_link_libraries(moco_tf_proto PUBLIC libprotobuf)
+
+# handling ModelMetainfo.proto
+unset(PROTO_FILES)
+list(APPEND PROTO_FILES ModelMetainfo.proto)
+
+Protobuf_Generate(MODEL_META_PROTO
+ "${CMAKE_CURRENT_BINARY_DIR}/generated"
+ "./"
+ ${PROTO_FILES})
+
+add_library(moco_tf_model_metainfo_proto STATIC ${MODEL_META_PROTO_SOURCES})
+set_target_properties(moco_tf_model_metainfo_proto PROPERTIES POSITION_INDEPENDENT_CODE ON)
+target_include_directories(moco_tf_model_metainfo_proto PUBLIC ${MODEL_META_PROTO_INCLUDE_DIRS})
+target_link_libraries(moco_tf_model_metainfo_proto PUBLIC libprotobuf)
--- /dev/null
+syntax = "proto3";
+
+ package moco;
+option cc_enable_arenas = true;
+
+ /* example of prototxt file
+ custom_op {
+ name: "my/customOp/000"
+ op: "new_custom_op"
+ attr {
+ key: "output_shape"
+ value {
+ shape {
+ dim { size: 1 }
+ dim { size: 2 }
+ dim { size: 1 }
+ dim { size: 2 }
+ }
+ }
+ }
+ }
+*/
+
+ message ShapeProto {
+ message Dim {
+ int64 size = 1; // tensorflow uses int64
+ };
+
+ repeated Dim dim = 2;
+}
+
+ message AttrValue {
+ oneof value {
+ ShapeProto shape = 1;
+ }
+}
+
+ message CustomOpDef {
+ string name = 1;
+ string op = 2;
+ map<string, AttrValue> attr = 3;
+}
+
+ message ModelMetaDef {
+ repeated CustomOpDef custom_op = 1;
+}