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

Function create_input_node

internal/bin/test_concat_op.cpp:57–86  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

55const char* gInputName[] = {"data1", "data2", "data3", "data4", "data5"};
56
57int create_input_node(graph_t graph, const char* node_name, int n, int c, int h, int w, int layout, int data_type)
58{
59 node_t node = create_graph_node(graph, node_name, "InputOp");
60 tensor_t tensor = create_graph_tensor(graph, node_name, data_type);
61
62 // printf("create_input_node [%d]:[%d]:[%d]:[%d]\n",n,c,h,w);
63 if(tensor == nullptr)
64 {
65 release_graph_node(node);
66 return -1;
67 }
68
69 set_node_output_tensor(node, 0, tensor, TENSOR_TYPE_INPUT);
70
71 if(layout == 0)
72 {
73 int dims[4] = {n, c, h, w};
74 set_tensor_shape(tensor, dims, 4);
75 }
76 else
77 {
78 int dims[4] = {n, h, w, c};
79 set_tensor_shape(tensor, dims, 4);
80 }
81
82 release_graph_tensor(tensor);
83 release_graph_node(node);
84
85 return 0;
86}
87
88int create_test_node(graph_t graph, const char* node_name, int axis, const char* inputs[], int input_counts)
89{

Callers 1

create_test_graphFunction · 0.70

Calls 6

create_graph_nodeFunction · 0.85
create_graph_tensorFunction · 0.85
release_graph_nodeFunction · 0.85
set_node_output_tensorFunction · 0.85
set_tensor_shapeFunction · 0.85
release_graph_tensorFunction · 0.85

Tested by

no test coverage detected