espnet2.gan_tts.utils.get_random_segments.get_random_segments
Less than 1 minute
espnet2.gan_tts.utils.get_random_segments.get_random_segments
espnet2.gan_tts.utils.get_random_segments.get_random_segments(x: Tensor, x_lengths: Tensor, segment_size: int) → Tuple[Tensor, Tensor]
Get random segments.
- Parameters:
- x (Tensor) – Input tensor (B, C, T).
- x_lengths (Tensor) – Length tensor (B,).
- segment_size (int) – Segment size.
- Returns: Segmented tensor (B, C, segment_size). Tensor: Start index tensor (B,).
- Return type: Tensor