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

Function create_conv_graph

internal/bin/test_graph.cpp:96–140  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

94}
95
96graph_t create_conv_graph(int c, int h, int w)
97{
98 graph_t graph = create_graph(nullptr, nullptr, nullptr);
99 set_graph_layout(graph, TENGINE_LAYOUT_NHWC);
100
101 if(graph == nullptr)
102 {
103 std::cerr << "ERRNO: " << get_tengine_errno() << "\n";
104 return nullptr;
105 }
106
107 const char* input_name = "data";
108 const char* conv_name = "conv";
109
110 if(create_input_node(graph, input_name, c, h, w) < 0)
111 {
112 std::cerr << "create input failed\n";
113 return nullptr;
114 }
115
116 if(create_conv_node(graph, conv_name, input_name, 3, 2, 0, c, c, c) < 0)
117 {
118 std::cerr << "create conv node failed\n";
119 return nullptr;
120 }
121
122 /* set input/output node */
123
124 const char* inputs[] = {input_name};
125 const char* outputs[] = {conv_name};
126
127 if(set_graph_input_node(graph, inputs, sizeof(inputs) / sizeof(char*)) < 0)
128 {
129 std::cerr << "set inputs failed: ERRNO: " << get_tengine_errno() << "\n";
130 return nullptr;
131 }
132
133 if(set_graph_output_node(graph, outputs, sizeof(outputs) / sizeof(char*)) < 0)
134 {
135 std::cerr << "set outputs failed: ERRNO: " << get_tengine_errno() << "\n";
136 return nullptr;
137 }
138
139 return graph;
140}
141
142int main(int argc, char* argv[])
143{

Callers 1

mainFunction · 0.70

Calls 7

create_graphFunction · 0.85
set_graph_layoutFunction · 0.85
get_tengine_errnoFunction · 0.85
set_graph_input_nodeFunction · 0.85
set_graph_output_nodeFunction · 0.85
create_input_nodeFunction · 0.70
create_conv_nodeFunction · 0.70

Tested by

no test coverage detected