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

Function test_concat

internal/bin/test_permute_op.cpp:423–474  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

421}
422
423int test_concat(const char* test_node_name, const std::vector<ConcatInputParam>& inputParam, int layout, int data_type)
424{
425 graph_t graph = create_test_graph(test_node_name, inputParam, layout, data_type);
426 graph_t graph1 = create_test_graph(test_node_name, inputParam, layout, 0);
427 if(graph == nullptr || graph1 == nullptr)
428 {
429 std::cout << "create graph failed!!!\n";
430 return 1;
431 }
432
433 set_input_data(graph, ( int )inputParam.size());
434 set_input_data(graph1, ( int )inputParam.size());
435
436 setenv("OPS_REGISTRY", "reference", 1);
437 setenv("OP_NAME", "Permute", 1);
438 if(prerun_graph(graph) < 0)
439 {
440 std::cerr << "prerun_graph failed: ERRNO: " << get_tengine_errno() << "\n";
441 return 1;
442 }
443
444 unsetenv("OPS_REGISTRY");
445 unsetenv("OP_NAME");
446
447 if(prerun_graph(graph1) < 0)
448 {
449 std::cerr << "prerun_graph failed: ERRNO: " << get_tengine_errno() << "\n";
450 return 1;
451 }
452
453 if(run_graph(graph, 1) < 0 || run_graph(graph1, 1) < 0)
454 {
455 std::cerr << "run_graph failed: ERRNO: " << get_tengine_errno() << "\n";
456 return 2;
457 }
458
459 node_t node_1 = get_graph_node(graph, test_node_name);
460 node_t node_2 = get_graph_node(graph1, test_node_name);
461 int ret = 0;
462 ret = comp_res(node_1, node_2, data_type);
463
464 release_graph_node(node_1);
465 release_graph_node(node_2);
466
467 postrun_graph(graph);
468
469 destroy_graph(graph);
470
471 release_all_mem();
472
473 return ret;
474}
475
476#define __PUSH_PARAM__(_n, _c, _h, _w) \
477 { \

Callers 1

testFunction · 0.70

Calls 12

prerun_graphFunction · 0.85
get_tengine_errnoFunction · 0.85
run_graphFunction · 0.85
get_graph_nodeFunction · 0.85
release_graph_nodeFunction · 0.85
postrun_graphFunction · 0.85
destroy_graphFunction · 0.85
create_test_graphFunction · 0.70
set_input_dataFunction · 0.70
comp_resFunction · 0.70
release_all_memFunction · 0.70
sizeMethod · 0.45

Tested by

no test coverage detected