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

Function find_permutation

src/permutation.cpp:44–52  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

42}
43
44std::vector<int64_t> find_permutation(const shape& s)
45{
46 std::vector<std::int64_t> result(s.lens().size());
47 std::iota(result.begin(), result.end(), 0);
48 std::stable_sort(result.begin(), result.end(), by(std::greater<>{}, [&](auto x) {
49 return std::make_tuple(s.strides()[x], s.lens()[x]);
50 }));
51 return result;
52}
53
54std::vector<int64_t> find_permutation(const std::vector<shape>& shapes)
55{

Callers 8

normalize_permutationFunction · 0.70
applyMethod · 0.70
with_lensMethod · 0.70
preserve_output_layoutFunction · 0.70
remove_layoutFunction · 0.70
compute_shapeMethod · 0.70
compute_shapeMethod · 0.70
TEST_CASEFunction · 0.50

Calls 11

iotaFunction · 0.85
stable_sortFunction · 0.85
lensMethod · 0.80
frontMethod · 0.80
byFunction · 0.50
make_tupleFunction · 0.50
sizeMethod · 0.45
beginMethod · 0.45
endMethod · 0.45
emptyMethod · 0.45
broadcastedMethod · 0.45

Tested by 1

TEST_CASEFunction · 0.40