| 67 | } |
| 68 | |
| 69 | struct compare_result { |
| 70 | float max_diff = 0.0f; |
| 71 | float mean_diff = 0.0f; |
| 72 | double cosine_sim = 0.0; |
| 73 | int n_elements = 0; |
| 74 | int n_bad = 0; // elements exceeding tolerance |
| 75 | }; |
| 76 | |
| 77 | static compare_result compare_tensors(const float * a, const float * b, int n, |
| 78 | float atol = 1e-4f) { |
nothing calls this directly
no outgoing calls
no test coverage detected