MCPcopy Create free account
hub / github.com/OAID/Tengine / create_test_graph

Function create_test_graph

internal/bin/test_eltwise_op.cpp:209–304  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

207}
208
209graph_t create_test_graph(const char* test_node_name, int c, int h, int w, int layout, int data_type, int i_type,
210 int case_num)
211{
212 graph_t graph = create_graph(nullptr, nullptr, nullptr);
213
214 if(graph == nullptr)
215 {
216 std::cerr << "create failed: ERRNO: " << get_tengine_errno() << "\n";
217 return nullptr;
218 }
219
220 if(set_graph_layout(graph, layout) < 0)
221 {
222 std::cerr << "set layout failed: ERRNO: " << get_tengine_errno() << "\n";
223 return nullptr;
224 }
225
226 const char* input_name = "data";
227 const char* input_name_1 = "data1";
228 if(layout == 0)
229 {
230 if(create_input_node(graph, input_name, c, h, w, data_type) < 0)
231 {
232 std::cerr << "create input failed\n";
233 return nullptr;
234 }
235 }
236 else
237 {
238 if(create_input_node_1(graph, input_name, c, h, w, data_type) < 0)
239 {
240 std::cerr << "create input failed\n";
241 return nullptr;
242 }
243 }
244
245 if(case_num == 1)
246 {
247 if(layout == 0)
248 {
249 if(create_input_node_Case1(graph, input_name_1, c, h, w, data_type) < 0)
250 {
251 std::cerr << "create input1 failed\n";
252 return nullptr;
253 }
254 }
255 else
256 {
257 if(create_input_node_Case1_NHWC(graph, input_name_1, c, h, w, data_type) < 0)
258 {
259 std::cerr << "create input1 failed\n";
260 return nullptr;
261 }
262 }
263 }
264 else if(case_num == 2)
265 {
266 if(create_input_node_Case2(graph, input_name_1, c, h, w, data_type) < 0)

Callers 1

mainFunction · 0.70

Calls 12

create_graphFunction · 0.85
get_tengine_errnoFunction · 0.85
set_graph_layoutFunction · 0.85
create_input_node_Case2Function · 0.85
create_input_node_Case3Function · 0.85
set_graph_input_nodeFunction · 0.85
set_graph_output_nodeFunction · 0.85
create_input_nodeFunction · 0.70
create_input_node_1Function · 0.70
create_input_node_Case1Function · 0.70
create_test_nodeFunction · 0.70

Tested by

no test coverage detected