MCPcopy Create free account
hub / github.com/MrNeRF/LichtFeld-Studio / TEST

Function TEST

tests/test_expression_templates.cpp:37–50  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

35// ============================================================================
36
37TEST(ExpressionTemplates, FunctorComposition2Way) {
38 // Test 2-way functor composition: g(f(x))
39 ops::exp_op f;
40 ops::neg_op g;
41
42 auto composed = ops::compose(f, g);
43
44 // Test on CPU
45 float x = 2.0f;
46 float result = composed(x);
47 float expected = -std::exp(x);
48
49 EXPECT_NEAR(result, expected, 1e-5f);
50}
51
52TEST(ExpressionTemplates, FunctorComposition3Way) {
53 // Test 3-way functor composition: h(g(f(x)))

Callers

nothing calls this directly

Calls 13

composeFunction · 0.85
shapeMethod · 0.80
expMethod · 0.80
reluMethod · 0.80
tensors_equalFunction · 0.70
absFunction · 0.50
device_implMethod · 0.45
deviceMethod · 0.45
dtype_implMethod · 0.45
dtypeMethod · 0.45
eval_implMethod · 0.45
absMethod · 0.45

Tested by

no test coverage detected