Eventually transpose specified data. :param args: tensors to eventually transpose (dependent on the state of "batch_first") :return: eventually transposed tensors
(self, *args: Tuple[Tensor, ...])
| 161 | module.reset_parameters() |
| 162 | |
| 163 | def _maybe_transpose(self, *args: Tuple[Tensor, ...]) -> Union[Tensor, Tuple[Tensor, ...]]: |
| 164 | """ |
| 165 | Eventually transpose specified data. |
| 166 | |
| 167 | :param args: tensors to eventually transpose (dependent on the state of "batch_first") |
| 168 | :return: eventually transposed tensors |
| 169 | """ |
| 170 | transposed_result = tuple(_.transpose(0, 1) for _ in args) if self.__batch_first else args |
| 171 | return transposed_result[0] if len(transposed_result) == 1 else transposed_result |
| 172 | |
| 173 | def _associate(self, data: Union[Tensor, Tuple[Tensor, Tensor, Tensor]], |
| 174 | return_raw_associations: bool = False, return_projected_patterns: bool = False, |
no outgoing calls
no test coverage detected