espnet2.gan_tts.vits.flow.ElementwiseAffineFlow
Less than 1 minute
espnet2.gan_tts.vits.flow.ElementwiseAffineFlow
class espnet2.gan_tts.vits.flow.ElementwiseAffineFlow(channels: int)
Bases: Module
Elementwise affine flow module.
Initialize ElementwiseAffineFlow module.
- Parameters:channels (int) – Number of channels.
forward(x: Tensor, x_mask: Tensor, inverse: bool = False, **kwargs) → Tensor | Tuple[Tensor, Tensor]
Calculate forward propagation.
- Parameters:
- x (Tensor) – Input tensor (B, channels, T).
- x_lengths (Tensor) – Length tensor (B,).
- 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