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

Function test_softmax_variations

test/op_shape_test.cpp:1610–1645  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1608}
1609
1610static void test_softmax_variations(const std::string& name)
1611{
1612 {
1613 migraphx::shape input{migraphx::shape::float_type, {2, 3, 4, 5}};
1614 expect_shape(migraphx::shape{migraphx::shape::float_type, {2, 3, 4, 5}},
1615 migraphx::make_op(name, {{"axis", 0}}),
1616 input);
1617 }
1618
1619 {
1620 migraphx::shape input{migraphx::shape::float_type, {2, 3, 4, 5}};
1621 expect_shape(migraphx::shape{migraphx::shape::float_type, {2, 3, 4, 5}},
1622 migraphx::make_op(name, {{"axis", 1}}),
1623 input);
1624 }
1625
1626 {
1627 migraphx::shape input{migraphx::shape::float_type, {2, 3, 4, 5}};
1628 expect_shape(migraphx::shape{migraphx::shape::float_type, {2, 3, 4, 5}},
1629 migraphx::make_op(name, {{"axis", 2}}),
1630 input);
1631 }
1632
1633 {
1634 migraphx::shape input{migraphx::shape::float_type, {2, 3, 4, 5}};
1635 expect_shape(migraphx::shape{migraphx::shape::float_type, {2, 3, 4, 5}},
1636 migraphx::make_op(name, {{"axis", 3}}),
1637 input);
1638 }
1639
1640 {
1641 migraphx::shape input{migraphx::shape::float_type, {2, 3, 4, 5}};
1642 int axis = 4;
1643 throws_shape(migraphx::make_op(name, {{"axis", axis}}), input);
1644 }
1645}
1646TEST_CASE(logsoftmax) { test_softmax_variations("logsoftmax"); }
1647
1648TEST_CASE(softmax) { test_softmax_variations("softmax"); }

Callers 1

TEST_CASEFunction · 0.85

Calls 3

expect_shapeFunction · 0.85
throws_shapeFunction · 0.85
make_opFunction · 0.50

Tested by

no test coverage detected