espnet2.tts.utils.duration_calculator.DurationCalculator
Less than 1 minute
espnet2.tts.utils.duration_calculator.DurationCalculator
class espnet2.tts.utils.duration_calculator.DurationCalculator(*args, **kwargs)
Bases: Module
Duration calculator module.
Initializes internal Module state, shared by both nn.Module and ScriptModule.
forward(att_ws: Tensor) → Tuple[Tensor, Tensor]
Convert attention weight to durations.
- Parameters:att_ws (Tesnor) – Attention weight tensor (T_feats, T_text) or (#layers, #heads, T_feats, T_text).
- Returns: Duration of each input (T_text,). Tensor: Focus rate value.
- Return type: LongTensor