| 1608 | } |
| 1609 | |
| 1610 | static 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 | } |
| 1646 | TEST_CASE(logsoftmax) { test_softmax_variations("logsoftmax"); } |
| 1647 | |
| 1648 | TEST_CASE(softmax) { test_softmax_variations("softmax"); } |
no test coverage detected