| 71 | } |
| 72 | |
| 73 | static bool check(const std::string & name, const float * got, const ref_tensor & ref, |
| 74 | float atol = 1e-4f, float rtol = 1e-3f) { |
| 75 | if (ref.data.empty()) { |
| 76 | fprintf(stderr, " [SKIP] %s — no reference data\n", name.c_str()); |
| 77 | return true; |
| 78 | } |
| 79 | float max_diff = compare_tensors(got, ref.data.data(), ref.numel(), atol, rtol); |
| 80 | bool ok = max_diff < atol + rtol; |
| 81 | fprintf(stderr, " %s %s: max_diff=%.6f (atol=%.1e rtol=%.1e)\n", |
| 82 | ok ? "[PASS]" : "[FAIL]", name.c_str(), max_diff, atol, rtol); |
| 83 | return ok; |
| 84 | } |
| 85 | |
| 86 | // ═══════════════════════════════════════════════════════════════════════════════ |
| 87 | // Test: preprocessing |
nothing calls this directly
no test coverage detected