espnet2.asr_transducer.utils.make_source_mask
Less than 1 minute
espnet2.asr_transducer.utils.make_source_mask
espnet2.asr_transducer.utils.make_source_mask(lengths: Tensor) → Tensor
Create source mask for given lengths.
Reference: https://github.com/k2-fsa/icefall/blob/master/icefall/utils.py
- Parameters:lengths – Sequence lengths. (B,)
- Returns: Mask for the sequence lengths. (B, max_len)