espnet.nets.pytorch_backend.transformer.mask.target_mask
Less than 1 minute
espnet.nets.pytorch_backend.transformer.mask.target_mask
espnet.nets.pytorch_backend.transformer.mask.target_mask(ys_in_pad, ignore_id)
Create mask for decoder self-attention.
- Parameters:
- ys_pad (torch.Tensor) – batch of padded target sequences (B, Lmax)
- ignore_id (int) – index of padding
- dtype (torch.dtype) – result dtype
- Return type: torch.Tensor (B, Lmax, Lmax)