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

Function maxerr

internal/bin/test_dw_conv_general.cpp:136–159  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

134}
135
136float maxerr(float *gt, float *pred, int size, int dump = 0)
137{
138 float maxError = 0.f;
139 float tmp =0.f;
140 for (int i = 0; i < size; i++) {
141 tmp = (float)fabs(gt[i] - pred[i]);
142 if (tmp > 0.01) {
143 printf("==============================================\n");
144 printf("mismatch at idx=%d, pred=%f, gt=%f\n", i, pred[i], gt[i]);
145 printf("dump data to file [gt_data, pred_data]\n");
146 printf("=============================================\n");
147 DumpFloat("gt_data", gt, size);
148 DumpFloat("pred_data", pred, size);
149 return -1;
150 }
151 maxError = MAX(tmp, maxError);
152 }
153 // printf("maxerr %f\n",maxError);
154 if (dump) {
155 DumpFloat("gt_data", gt, size);
156 DumpFloat("pred_data", pred, size);
157 }
158 return maxError;
159}
160graph_t create_conv_graph(int c, int h, int w, int ksize, int stride, int pad, int group,int dilation)
161{
162 graph_t graph = create_graph(nullptr, nullptr, nullptr);

Callers 1

mainFunction · 0.70

Calls 1

DumpFloatFunction · 0.70

Tested by

no test coverage detected