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

Method to_src_from_common

src/shape_transform_descriptor.cpp:1806–1825  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1804 return result;
1805}
1806shape_transform_descriptor shape_transform_descriptor::to_src_from_common() const
1807{
1808 shape_transform_descriptor result;
1809 auto subs = get_all_subdimensions(dimensions);
1810 result.rank = subs.size();
1811 transform(group_axes(subs), std::back_inserter(result.dimensions), [&](auto&& p) -> dimension {
1812 const auto& [axis, gsubs] = p;
1813 std::vector<dimension::sub> subdimensions;
1814 transform(gsubs, std::back_inserter(subdimensions), [&](const dimension::sub* s) {
1815 dimension::sub result = *s;
1816 std::size_t i = s - subs.data();
1817 set_origin_axis(result, {i});
1818 result.expose();
1819 return result;
1820 });
1821 return {subdimensions};
1822 });
1823 result.simplify();
1824 return result;
1825}
1826
1827std::vector<std::vector<std::size_t>> shape_transform_descriptor::common_axes_map_from_src() const
1828{

Callers 2

TEST_CASEFunction · 0.80
applyMethod · 0.80

Calls 8

get_all_subdimensionsFunction · 0.85
group_axesFunction · 0.85
set_origin_axisFunction · 0.85
exposeMethod · 0.80
simplifyMethod · 0.80
transformFunction · 0.50
sizeMethod · 0.45
dataMethod · 0.45

Tested by

no test coverage detected