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

Function require_vector_close

tests/unittests/test_diffusion_math.cpp:19–30  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

17}
18
19void require_vector_close(
20 const std::vector<float> & actual,
21 const std::vector<float> & expected,
22 float tolerance,
23 const char * label) {
24 if (actual.size() != expected.size()) {
25 throw std::runtime_error(std::string(label) + " size mismatch");
26 }
27 for (size_t i = 0; i < actual.size(); ++i) {
28 require_close(actual[i], expected[i], tolerance, label);
29 }
30}
31
32void test_guidance() {
33 const std::vector<float> pred_cond{0.4F, -0.2F, 0.8F, -0.5F, 0.1F, 0.6F};

Callers 3

test_guidanceFunction · 0.70
test_velocity_and_stepsFunction · 0.70
test_masksFunction · 0.70

Calls 3

require_closeFunction · 0.70
stringFunction · 0.50
sizeMethod · 0.45

Tested by

no test coverage detected