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

Function select_mask

src/shape_transform_descriptor.cpp:2094–2108  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2092
2093template <class Range>
2094static std::vector<std::size_t> select_mask(const std::vector<std::size_t>& slice_mask,
2095 const Range& r)
2096{
2097 std::vector<std::size_t> result;
2098 std::transform(slice_mask.begin(),
2099 slice_mask.end(),
2100 r.begin(),
2101 join_back_inserter(result),
2102 [](std::size_t mask, std::size_t n) -> std::vector<std::size_t> {
2103 if(mask == 0)
2104 return {};
2105 return {n};
2106 });
2107 return result;
2108}
2109
2110// Generate the shape transforms for strided view
2111optional<std::vector<operation>>

Callers 1

Calls 4

join_back_inserterFunction · 0.85
transformFunction · 0.50
beginMethod · 0.45
endMethod · 0.45

Tested by

no test coverage detected