class_docstr: Transformer-TTS module.
  
  This is a module of text-to-speech Transformer described in `Neural Speech Synthesis
  with Transformer Network`_, which convert the sequence of tokens into the sequence
  of Mel-filterbanks.
  
  .. _`Neural Speech Synthesis with Transformer Network`:
      https://arxiv.org/pdf/1809.08895.pdf
docstr: Make masks for self-attention.
  
  Args:
      ilens (LongTensor): Batch of lengths (B,).
  
  Returns:
      Tensor: Mask tensor for self-attention.
              dtype=torch.uint8 in PyTorch 1.2-
              dtype=torch.bool in PyTorch 1.2+ (including 1.2)
  
  Examples:
      >>> ilens = [5, 3]
      >>> self._source_mask(ilens)
      tensor([[[1, 1, 1, 1, 1],
              [[1, 1, 1, 0, 0]]], dtype=torch.uint8)
docstr_tok: ["Make","masks","for","self-attention",".","Args",":","ilens","(","LongTensor",")",":","Batch","of","lengths","(","B",",",")",".","Returns",":","Tensor",":","Mask","tensor","for","self-attention",".","dtype=torch.uint8","in","PyTorch","1.2-","dtype=torch.bool","in","PyTorch","1.2+","(","including","1.2",")","Examples",":",">",">",">","ilens","=","[","5",",","3","]",">",">",">","self._source_mask","(","ilens",")","tensor","(","[","[","[","1",",","1",",","1",",","1",",","1","]",",","[","[","1",",","1",",","1",",","0",",","0","]","]","]",",","dtype=torch.uint8",")"]
code: def _source_mask(self, ilens):
      """Make masks for self-attention.
  
      Args:
          ilens (LongTensor): Batch of lengths (B,).
  
      Returns:
          Tensor: Mask tensor for self-attention.
                  dtype=torch.uint8 in PyTorch 1.2-
                  dtype=torch.bool in PyTorch 1.2+ (including 1.2)
  
      Examples:
          >>> ilens = [5, 3]
          >>> self._source_mask(ilens)
          tensor([[[1, 1, 1, 1, 1],
                  [[1, 1, 1, 0, 0]]], dtype=torch.uint8)
  
      """
      x_masks = make_non_pad_mask(ilens).to(
          next(self.parameters()).device
      )
      return x_masks.unsqueeze(-2)
  
imports: from typing import Dict, Optional, Sequence, Tuple
  import torch
  import torch.nn.functional
  from typeguard import check_argument_types
  from espnet2.torch_utils.device_funcs import force_gatherable
  from espnet2.torch_utils.initialize import initialize
  from espnet2.tts.abs_tts import AbsTTS
  from espnet2.tts.gst.style_encoder import StyleEncoder
  from espnet.nets.pytorch_backend.e2e_tts_transformer import GuidedMultiHeadAttentionLoss, TransformerLoss
  from espnet.nets.pytorch_backend.nets_utils import make_non_pad_mask, make_pad_mask
  from espnet.nets.pytorch_backend.tacotron2.decoder import Postnet
  from espnet.nets.pytorch_backend.tacotron2.decoder import Prenet
  from espnet.nets.pytorch_backend.tacotron2.encoder import Encoder
  from espnet.nets.pytorch_backend.transformer.attention import MultiHeadedAttention
  from espnet.nets.pytorch_backend.transformer.decoder import Decoder
  from espnet.nets.pytorch_backend.transformer.embedding import PositionalEncoding, ScaledPositionalEncoding
  from espnet.nets.pytorch_backend.transformer.encoder import Encoder
  from espnet.nets.pytorch_backend.transformer.mask import subsequent_mask
label_desc: Use image node_id 7 for calling the Transformer obj's underlying member method code with example usage: obj._source_mask(ilens) and returns: x_masks