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

Function create_scatter_elements_program_3x3

test/ref/scatter_elements.cpp:239–260  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

237}
238
239static migraphx::program create_scatter_elements_program_3x3(const std::string& reduction_mode,
240 int axis)
241{
242 migraphx::program p;
243 auto* mm = p.get_main_module();
244 migraphx::shape sd{migraphx::shape::float_type, {3, 3}};
245 std::vector<float> vd(sd.elements(), 3.0f);
246
247 migraphx::shape si{migraphx::shape::int32_type, {3, 2}};
248 std::vector<int> vi = {1, 0, 0, 2, 2, 1};
249
250 migraphx::shape su{migraphx::shape::float_type, {3, 2}};
251 std::vector<float> vu = {1.0, 7.0, 1.1, 7.1, 1.2, 7.2};
252
253 auto ld = mm->add_literal(migraphx::literal{sd, vd});
254 auto li = mm->add_literal(migraphx::literal{si, vi});
255 auto lu = mm->add_literal(migraphx::literal{su, vu});
256 auto r = mm->add_instruction(
257 migraphx::make_op("scatter_" + reduction_mode, {{"axis", axis}}), ld, li, lu);
258 mm->add_return({r});
259 return p;
260}
261
262TEST_CASE(scatter_elements_none_axis_0_3x3_test)
263{

Callers 1

TEST_CASEFunction · 0.85

Calls 6

get_main_moduleMethod · 0.80
make_opFunction · 0.50
elementsMethod · 0.45
add_literalMethod · 0.45
add_instructionMethod · 0.45
add_returnMethod · 0.45

Tested by

no test coverage detected