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

Function run_shape_transforms

test/shape_transform_descriptor.cpp:82–98  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

80}
81
82static std::vector<int64_t> run_shape_transforms(const std::vector<std::size_t>& dims,
83 const std::vector<migraphx::operation>& ops)
84{
85 migraphx::shape s{migraphx::shape::int64_type, dims};
86 std::vector<int64_t> data(s.elements());
87 std::iota(data.begin(), data.end(), 0);
88
89 migraphx::program p;
90 auto* mm = p.get_main_module();
91 auto start = mm->add_literal(s, data);
92 for(const auto& op : ops)
93 start = mm->add_instruction(op, start);
94 mm->add_return({start});
95
96 auto result = p.eval({}).at(0);
97 return result.to_vector<int64_t>();
98}
99
100static std::vector<int64_t> run_strided_view(const migraphx::shape& s, std::int64_t offset)
101{

Callers 2

generate_forFunction · 0.85

Calls 10

iotaFunction · 0.85
get_main_moduleMethod · 0.80
atMethod · 0.80
elementsMethod · 0.45
beginMethod · 0.45
endMethod · 0.45
add_literalMethod · 0.45
add_instructionMethod · 0.45
add_returnMethod · 0.45
evalMethod · 0.45

Tested by

no test coverage detected