MCPcopy Create free account
hub / github.com/ROCm/AMDMIGraphX / TEST_CASE

Function TEST_CASE

test/rewrite_reduce.cpp:44–60  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

42}
43
44TEST_CASE(softmax)
45{
46 migraphx::shape s{migraphx::shape::float_type, {10, 1000}};
47 migraphx::module m;
48 auto x = m.add_parameter("x", s);
49 auto softmax = m.add_instruction(migraphx::make_op("softmax", {{"axis", 1}}), x);
50 m.add_return({softmax});
51 run_pass(m);
52 EXPECT(none_of(migraphx::iterator_for(m), [](auto ins) { return ins->name() == "softmax"; }));
53
54 auto reduces = find_all(migraphx::iterator_for(m),
55 [&](auto ins) { return migraphx::contains(ins->name(), "reduce"); });
56 EXPECT(all_of(reduces, [](auto ins) {
57 auto axes = ins->get_operator().to_value()["axes"].template to_vector<int64_t>();
58 return axes.size() == 1 and axes[0] == 1;
59 }));
60}
61
62TEST_CASE(softmax_upcast)
63{

Callers

nothing calls this directly

Calls 15

iterator_forFunction · 0.85
find_allFunction · 0.85
containsFunction · 0.85
make_targetFunction · 0.85
iotaFunction · 0.85
verify_rms_rangeFunction · 0.85
add_reduce_meanFunction · 0.85
add_common_opFunction · 0.85
add_parameterMethod · 0.80
lensMethod · 0.80
get_returnsMethod · 0.80
get_main_moduleMethod · 0.80

Tested by

no test coverage detected