calculate max_error between pred_data and ground_truth_data
| 68 | |
| 69 | // calculate max_error between pred_data and ground_truth_data |
| 70 | void 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 | } |
| 81 | bool CompareFloatTensor(float* a, float* b, std::vector<int>& shape_dim, std::vector<int>& mismatch_dim) |
| 82 | { |
| 83 | int total_size = 1; |