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

Function create_pool_graph

internal/bin/test_pooling_int8.cpp:80–124  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

78}
79
80graph_t create_pool_graph(int c, int h, int w, int k_h, int k_w, int s_h, int s_w, int pad_h0, int pad_w0, int pad_h1,
81 int pad_w1, int m)
82{
83 graph_t graph = create_graph(nullptr, nullptr, nullptr);
84
85 if(graph == nullptr)
86 {
87 std::cerr << "ERRNO: " << get_tengine_errno() << "\n";
88 return nullptr;
89 }
90
91 const char* input_name = "data";
92 const char* pool_name = "pool";
93
94 if(create_input_node(graph, input_name, c, h, w) < 0)
95 {
96 std::cerr << "create input failed\n";
97 return nullptr;
98 }
99
100 if(create_pool_node(graph, pool_name, input_name, k_h, k_w, s_h, s_w, pad_h0, pad_w0, pad_h1, pad_w1, m) < 0)
101 {
102 std::cerr << "create pool node failed\n";
103 return nullptr;
104 }
105
106 /* set input/output node */
107
108 const char* inputs[] = {input_name};
109 const char* outputs[] = {pool_name};
110
111 if(set_graph_input_node(graph, inputs, sizeof(inputs) / sizeof(char*)) < 0)
112 {
113 std::cerr << "set inputs failed: ERRNO: " << get_tengine_errno() << "\n";
114 return nullptr;
115 }
116
117 if(set_graph_output_node(graph, outputs, sizeof(outputs) / sizeof(char*)) < 0)
118 {
119 std::cerr << "set outputs failed: ERRNO: " << get_tengine_errno() << "\n";
120 return nullptr;
121 }
122
123 return graph;
124}
125
126int test_pool(int c, int h, int w, int k_h, int k_w, int s_h, int s_w, int pad_h0, int pad_w0, int pad_h1, int pad_w1,
127 int m)

Callers 1

test_poolFunction · 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_pool_nodeFunction · 0.70

Tested by

no test coverage detected