dynamic shape
| 3147 | |
| 3148 | // dynamic shape |
| 3149 | static void test_dyn_reduce_ops(const std::string& name) |
| 3150 | { |
| 3151 | { |
| 3152 | migraphx::shape input{migraphx::shape::float_type, {{2, 3, {3}}, {2, 4, {4}}}}; |
| 3153 | expect_shape( |
| 3154 | migraphx::shape{migraphx::shape::float_type, |
| 3155 | std::vector<migraphx::shape::dynamic_dimension>({{2, 3, {3}}, {1, 1}})}, |
| 3156 | migraphx::make_op(name, {{"axes", {-1}}}), |
| 3157 | input); |
| 3158 | } |
| 3159 | { |
| 3160 | migraphx::shape input{migraphx::shape::float_type, {{2, 3, {3}}, {2, 4, {4}}}}; |
| 3161 | expect_shape( |
| 3162 | migraphx::shape{migraphx::shape::float_type, |
| 3163 | std::vector<migraphx::shape::dynamic_dimension>({{1, 1}, {2, 4, {4}}})}, |
| 3164 | migraphx::make_op(name, {{"axes", {0}}}), |
| 3165 | input); |
| 3166 | } |
| 3167 | { |
| 3168 | migraphx::shape input{migraphx::shape::float_type, {{2, 3, {3}}, {2, 4, {4}}}}; |
| 3169 | expect_shape( |
| 3170 | migraphx::shape{migraphx::shape::float_type, |
| 3171 | std::vector<migraphx::shape::dynamic_dimension>({{1, 1}, {1, 1}})}, |
| 3172 | migraphx::make_op(name, {{"axes", {0, 1}}}), |
| 3173 | input); |
| 3174 | } |
| 3175 | { |
| 3176 | migraphx::shape input{migraphx::shape::float_type, {{2, 3, {3}}, {2, 4, {4}}}}; |
| 3177 | throws_shape(migraphx::make_op(name, {{"axes", {4}}}), input); |
| 3178 | } |
| 3179 | } |
| 3180 | |
| 3181 | static void test_reduce_ops_variable_axes(const std::string& name) |
| 3182 | { |
no test coverage detected