MCPcopy Create free account
hub / github.com/DeepRec-AI/DeepRec / GetPermutationIfAvailable

Function GetPermutationIfAvailable

tensorflow/compiler/mlir/xla/hlo_utils.cc:44–54  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

42}
43
44llvm::SmallVector<AffineMap, 2> GetPermutationIfAvailable(
45 const Shape& shape, mlir::Builder builder) {
46 if (!shape.has_layout() || shape.layout().minor_to_major().empty()) {
47 return {};
48 }
49 llvm::SmallVector<unsigned, 2> permutation;
50 for (auto dim : llvm::reverse(shape.layout().minor_to_major())) {
51 permutation.push_back(dim);
52 }
53 return {AffineMap::getPermutationMap(permutation, builder.getContext())};
54}
55
56} // namespace
57

Callers 1

Calls 7

reverseFunction · 0.85
has_layoutMethod · 0.80
minor_to_majorMethod · 0.80
getContextMethod · 0.80
emptyMethod · 0.45
layoutMethod · 0.45
push_backMethod · 0.45

Tested by

no test coverage detected