espnet2.gan_tts.vits.flow.ConvFlow
Less than 1 minute
espnet2.gan_tts.vits.flow.ConvFlow
class espnet2.gan_tts.vits.flow.ConvFlow(in_channels: int, hidden_channels: int, kernel_size: int, layers: int, bins: int = 10, tail_bound: float = 5.0)
Bases: Module
Convolutional flow module.
Initialize ConvFlow module.
- Parameters:
- in_channels (int) – Number of input channels.
- hidden_channels (int) – Number of hidden channels.
- kernel_size (int) – Kernel size.
- layers (int) – Number of layers.
- bins (int) – Number of bins.
- tail_bound (float) – Tail bound value.
forward(x: Tensor, x_mask: Tensor, g: Tensor | None = None, inverse: bool = False) → Tensor | Tuple[Tensor, Tensor]
Calculate forward propagation.
- Parameters:
- x (Tensor) – Input tensor (B, channels, T).
- x_mask (Tensor) – Mask tensor (B,).
- g (Optional *[*Tensor ]) – Global conditioning tensor (B, channels, 1).
- inverse (bool) – Whether to inverse the flow.
- Returns: Output tensor (B, channels, T). Tensor: Log-determinant tensor for NLL (B,) if not inverse.
- Return type: Tensor