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

Function create_scatter_elements_program2

test/ref/scatter_elements.cpp:91–112  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

89}
90
91static migraphx::program create_scatter_elements_program2(const std::string& reduction_mode,
92 int axis)
93{
94 migraphx::program p;
95 auto* mm = p.get_main_module();
96 migraphx::shape sd{migraphx::shape::float_type, {1, 5}};
97 std::vector<float> vd({1., 2., 3., 4., 5.});
98
99 migraphx::shape si{migraphx::shape::int32_type, {1, 2}};
100 std::vector<int> vi = {1, 3};
101
102 migraphx::shape su{migraphx::shape::float_type, {1, 2}};
103 std::vector<float> vu = {1.1, 2.1};
104
105 auto ld = mm->add_literal(migraphx::literal{sd, vd});
106 auto li = mm->add_literal(migraphx::literal{si, vi});
107 auto lu = mm->add_literal(migraphx::literal{su, vu});
108 auto r = mm->add_instruction(
109 migraphx::make_op("scatter_" + reduction_mode, {{"axis", axis}}), ld, li, lu);
110 mm->add_return({r});
111 return p;
112}
113
114TEST_CASE(scatter_elements_none_axis_1_test)
115{

Callers 1

TEST_CASEFunction · 0.85

Calls 5

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

Tested by

no test coverage detected