| 18 | } |
| 19 | |
| 20 | void require_vector_close( |
| 21 | const std::vector<float> & actual, |
| 22 | const std::vector<float> & expected, |
| 23 | float tolerance, |
| 24 | const char * label) { |
| 25 | if (actual.size() != expected.size()) { |
| 26 | throw std::runtime_error(std::string(label) + " size mismatch"); |
| 27 | } |
| 28 | for (size_t index = 0; index < actual.size(); ++index) { |
| 29 | require_close(actual[index], expected[index], tolerance, label); |
| 30 | } |
| 31 | } |
| 32 | |
| 33 | void test_float32_matches_torch_cuda() { |
| 34 | const std::vector<float> expected_seed_1234 = { |
no test coverage detected