espnet2.gan_tts.vits.flow.LogFlow
Less than 1 minute
espnet2.gan_tts.vits.flow.LogFlow
class espnet2.gan_tts.vits.flow.LogFlow(*args, **kwargs)
Bases: Module
Log flow module.
Initializes internal Module state, shared by both nn.Module and ScriptModule.
forward(x: Tensor, x_mask: Tensor, inverse: bool = False, eps: float = 1e-05, **kwargs) → Tensor | Tuple[Tensor, Tensor]
Calculate forward propagation.
- Parameters:
- x (Tensor) – Input tensor (B, channels, T).
- x_mask (Tensor) – Mask tensor (B, 1, T).
- inverse (bool) – Whether to inverse the flow.
- eps (float) – Epsilon for log.
- Returns: Output tensor (B, channels, T). Tensor: Log-determinant tensor for NLL (B,) if not inverse.
- Return type: Tensor