(self, shape: EinsumShape)
| 68 | return EinsumOperand(shape, self._ctx.transpose(self._tracer, axis), self._ctx) |
| 69 | |
| 70 | def reduce(self, shape: EinsumShape) -> "EinsumOperand": |
| 71 | if shape == self._shape: |
| 72 | return self |
| 73 | for dim in shape: |
| 74 | assert len(dim) == 1 |
| 75 | assert dim in self.shape |
| 76 | axis = [*filter(lambda x: self.shape[x] not in shape, range(len(self.shape)))] |
| 77 | assert tuple([*filter(lambda x: x in shape, self.shape)]) == shape |
| 78 | return EinsumOperand(shape, self._ctx.reduce(self._tracer, axis), self._ctx) |
| 79 | |
| 80 | # TODO: Some scenarios should be re-implemented using dnn kernel |
| 81 | def diag_plane(self, shape: EinsumShape) -> "EinsumOperand": |
no test coverage detected