(self, transposed: bool = False)
| 194 | |
| 195 | class BatchMatrixMultiplication(nn.Module): |
| 196 | def __init__(self, transposed: bool = False) -> None: |
| 197 | super().__init__() |
| 198 | |
| 199 | # Whether the last 2 dims (-1, -2) of the input has already been |
| 200 | # transposed. If yes, transpose it back before feeding to torch.bmm |
| 201 | self.transposed: bool = transposed |
| 202 | |
| 203 | def forward(self, x: Tensor, y: Tensor) -> Tensor: |
| 204 | if self.transposed: |