class_docstr: Feed Forward Transformer for TTS a.k.a. FastSpeech.
  
  This is a module of FastSpeech,
  feed-forward Transformer with duration predictor described in
  `FastSpeech: Fast, Robust and Controllable Text to Speech`_,
  which does not require any auto-regressive
  processing during inference,
  resulting in fast decoding compared with auto-regressive Transformer.
  
  .. _`FastSpeech: Fast, Robust and Controllable Text to Speech`:
      https://arxiv.org/pdf/1905.09263.pdf
class_docstr_tok: ["Feed","Forward","Transformer","for","TTS","a.k.a",".","FastSpeech",".","This","is","a","module","of","FastSpeech",",","feed-forward","Transformer","with","duration","predictor","described","in","`","FastSpeech",":","Fast",",","Robust","and","Controllable","Text","to","Speech","`","_",",","which","does","not","require","any","auto-regressive","processing","during","inference",",","resulting","in","fast","decoding","compared","with","auto-regressive","Transformer",".","..","_","`","FastSpeech",":","Fast",",","Robust","and","Controllable","Text","to","Speech","`",":","https",":","\/\/arxiv.org\/pdf\/1905.09263.pdf"]
docstr: Make masks for self-attention.
  
  Args:
      ilens (LongTensor or List): 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","or","List",")",":","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 or List): 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)
      return x_masks.unsqueeze(-2)
  
imports: import logging
  import torch
  import torch.nn.functional
  from espnet.asr.asr_utils import get_model_conf, torch_load
  from espnet.nets.pytorch_backend.fastspeech.duration_calculator import DurationCalculator
  from espnet.nets.pytorch_backend.fastspeech.duration_predictor import DurationPredictor, DurationPredictorLoss
  from espnet.nets.pytorch_backend.fastspeech.length_regulator import LengthRegulator
  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.transformer.attention import MultiHeadedAttention
  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.initializer import initialize
  from espnet.nets.tts_interface import TTSInterface
  from espnet.utils.cli_utils import strtobool
  from espnet.utils.fill_missing_args import fill_missing_args
label_desc: Use image node_id 8 for calling the FeedForwardTransformer obj's underlying member method code with example usage: obj._source_mask(ilens) and returns: x_masks