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

Function test_reduce_ops

test/op_shape_test.cpp:3116–3146  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

3114}
3115
3116static void test_reduce_ops(const std::string& name)
3117{
3118 {
3119 migraphx::shape input{migraphx::shape::float_type, {2, 3, 4, 5}};
3120 expect_shape(migraphx::shape{migraphx::shape::float_type, {1, 1, 1, 1}},
3121 migraphx::make_op(name, {{"axes", {0, 1, 2, 3}}}),
3122 input);
3123 }
3124 {
3125 migraphx::shape input{migraphx::shape::float_type, {2, 3, 4, 5}};
3126 expect_shape(migraphx::shape{migraphx::shape::float_type, {2, 3, 1, 1}},
3127 migraphx::make_op(name, {{"axes", {2, 3}}}),
3128 input);
3129 }
3130 {
3131 migraphx::shape input{migraphx::shape::float_type, {2, 3, 4, 5}};
3132 expect_shape(migraphx::shape{migraphx::shape::float_type, {1, 3, 4, 5}},
3133 migraphx::make_op(name, {{"axes", {0}}}),
3134 input);
3135 }
3136 {
3137 migraphx::shape input{migraphx::shape::float_type, {2, 3, 4, 5}};
3138 expect_shape(migraphx::shape{migraphx::shape::float_type, {2, 3, 4, 1}},
3139 migraphx::make_op(name, {{"axes", {-1}}}),
3140 input);
3141 }
3142 {
3143 migraphx::shape input{migraphx::shape::float_type, {2, 3, 4, 5}};
3144 throws_shape(migraphx::make_op(name, {{"axes", {4}}}), input);
3145 }
3146}
3147
3148// dynamic shape
3149static void test_dyn_reduce_ops(const std::string& name)

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