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

Function create_conv_graph

internal/bin/test_deconv.cpp:98–142  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

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

Callers 1

mainFunction · 0.70

Calls 6

create_graphFunction · 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