MCPcopy Create free account
hub / github.com/0xShug0/audio.cpp / require_vector_close

Function require_vector_close

tests/unittests/test_torch_random.cpp:20–31  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

18}
19
20void 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
33void test_float32_matches_torch_cuda() {
34 const std::vector<float> expected_seed_1234 = {

Calls 3

require_closeFunction · 0.70
stringFunction · 0.50
sizeMethod · 0.45

Tested by

no test coverage detected