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

Function CalcMaxError

core/lib/debug_utils.cpp:70–80  ·  view source on GitHub ↗

calculate max_error between pred_data and ground_truth_data

Source from the content-addressed store, hash-verified

68
69// calculate max_error between pred_data and ground_truth_data
70void CalcMaxError(float* pred, float* gt, int size)
71{
72 float maxError = 0.f;
73 for(int i = 0; i < size; i++)
74 {
75 maxError = std::max(( float )fabs(gt[i] - pred[i]), maxError);
76 }
77 std::cout << "====================================\n ";
78 std::cout << "maxError is " << maxError << std::endl;
79 std::cout << "====================================\n ";
80}
81bool CompareFloatTensor(float* a, float* b, std::vector<int>& shape_dim, std::vector<int>& mismatch_dim)
82{
83 int total_size = 1;

Callers 4

test_new_operatorFunction · 0.85
test_new_operatorFunction · 0.85
test_new_operatorFunction · 0.85
test_new_operatorFunction · 0.85

Calls 1

maxFunction · 0.85

Tested by 4

test_new_operatorFunction · 0.68
test_new_operatorFunction · 0.68
test_new_operatorFunction · 0.68
test_new_operatorFunction · 0.68