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

Method reshape

imperative/python/megengine/functional/einsum.py:43–49  ·  view source on GitHub ↗
(self, shape: EinsumShape)

Source from the content-addressed store, hash-verified

41 return self._shape
42
43 def reshape(self, shape: EinsumShape) -> "EinsumOperand":
44 if shape == self._shape:
45 return self
46 shape_val = tuple(map(lambda x: self._ctx.dims2val(x), shape))
47 return EinsumOperand(
48 shape, self._ctx.reshape(self._tracer, shape_val), self._ctx
49 )
50
51 def broadcast(self, shape: EinsumShape) -> "EinsumOperand":
52 if shape == self._shape:

Callers 15

ctc_lossFunction · 0.45
embeddingFunction · 0.45
_merge_masksFunction · 0.45
multi_head_attentionFunction · 0.45
nmsFunction · 0.45
interpolateFunction · 0.45
argsortFunction · 0.45
sortFunction · 0.45
restoreFunction · 0.45
einsum_matmulFunction · 0.45
_get_idxFunction · 0.45
gatherFunction · 0.45

Calls 1

EinsumOperandClass · 0.85

Tested by

no test coverage detected