MCPcopy Create free account
hub / github.com/DeepRec-AI/DeepRec / BuildNode

Function BuildNode

tensorflow/lite/toco/import_tensorflow_test.cc:77–97  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

75}
76
77NodeDef BuildNode(
78 const std::string& op,
79 const std::vector<std::initializer_list<int>>& output_shapes) {
80 NodeDef node;
81 node.set_op(op);
82 node.set_name("Node1");
83 node.add_input();
84 node.set_input(0, "Node0");
85
86 AttrValue::ListValue* shapes =
87 (*node.mutable_attr())["_output_shapes"].mutable_list();
88 for (const auto& output_shape : output_shapes) {
89 tensorflow::TensorShapeProto* shape = shapes->add_shape();
90 for (int64_t output_shape_dim : output_shape) {
91 auto shape_dim = shape->add_dim();
92 shape_dim->set_size(output_shape_dim);
93 }
94 }
95
96 return node;
97}
98
99namespace {
100void BuildConstNode(std::initializer_list<int64_t> shape,

Callers 1

TESTFunction · 0.85

Calls 6

set_opMethod · 0.80
set_inputMethod · 0.80
add_shapeMethod · 0.80
set_nameMethod · 0.45
add_inputMethod · 0.45
set_sizeMethod · 0.45

Tested by

no test coverage detected