espnet2.gan_tts.vits.flow.Transpose
Less than 1 minute
espnet2.gan_tts.vits.flow.Transpose
class espnet2.gan_tts.vits.flow.Transpose(dim1: int, dim2: int)
Bases: Module
Transpose module for torch.nn.Sequential().
This module transposes the specified dimensions of the input tensor.
dim1
The first dimension to transpose.
- Type: int
dim2
The second dimension to transpose.
Type: int
Parameters:
- dim1 (int) – The first dimension to be transposed.
- dim2 (int) – The second dimension to be transposed.
Returns: The transposed tensor.
Return type: Tensor
Examples
>>> transpose = Transpose(1, 2)
>>> input_tensor = torch.randn(2, 3, 4) # Shape: (B, C, T)
>>> output_tensor = transpose(input_tensor)
>>> print(output_tensor.shape) # Shape: (B, T, C)
Initialize Transpose module.
forward(x: Tensor) → Tensor
Transpose module for torch.nn.Sequential().