MCPcopy Create free account
hub / github.com/MegEngine/MegEngine / transpose

Function transpose

imperative/python/megengine/xla/rules/tensor.py:72–78  ·  view source on GitHub ↗
(inp, permutation)

Source from the content-addressed store, hash-verified

70
71
72def transpose(inp, permutation):
73 assert len(inp.shape) == len(
74 permutation
75 ), f"incompatible shape and permutation: {inp.shape} vs {permutation}"
76 return HLOTensor(
77 hlo.TransposeOp(inp.tensor, ir_utils.dense_int_elements(permutation)).result
78 )
79
80
81def expand_dims(inp, axis):

Callers 2

transposeMethod · 0.70
dim_shuffle_lowerFunction · 0.70

Calls 1

HLOTensorClass · 0.85

Tested by

no test coverage detected