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
code: def _forward(
      self,
      xs: torch.Tensor,
      ilens: torch.Tensor,
      ys: torch.Tensor,
      olens: torch.Tensor,
      spembs: torch.Tensor,
      sids: torch.Tensor,
      lids: torch.Tensor,
  ) -> Tuple[torch.Tensor, torch.Tensor, torch.Tensor]:
      # forward encoder
      x_masks = self._source_mask(ilens)
      hs, h_masks = self.encoder(xs, x_masks)
  
      # integrate with GST
      if self.use_gst:
          style_embs = self.gst(ys)
          hs = hs + style_embs.unsqueeze(1)
  
      # integrate with SID and LID embeddings
      if self.spks is not None:
          sid_embs = self.sid_emb(sids.view(-1))
          hs = hs + sid_embs.unsqueeze(1)
      if self.langs is not None:
          lid_embs = self.lid_emb(lids.view(-1))
          hs = hs + lid_embs.unsqueeze(1)
  
      # integrate speaker embedding
      if self.spk_embed_dim is not None:
          hs = self._integrate_with_spk_embed(hs, spembs)
  
      # thin out frames for reduction factor
      # (B, T_feats, odim) ->  (B, T_feats//r, odim)
      if self.reduction_factor > 1:
          ys_in = ys[
              :, self.reduction_factor - 1 :: self.reduction_factor
          ]
          olens_in = olens.new(
              [
                  torch.div(
                      olen, self.reduction_factor, rounding_mode="trunc"
                  )
                  for olen in olens
              ]
          )
      else:
          ys_in, olens_in = ys, olens
  
      # add first zero frame and remove last frame for auto-regressive
      ys_in = self._add_first_frame_and_remove_last_frame(ys_in)
  
      # forward decoder
      y_masks = self._target_mask(olens_in)
      zs, _ = self.decoder(ys_in, y_masks, hs, h_masks)
      # (B, T_feats//r, odim * r) -> (B, T_feats//r * r, odim)
      before_outs = self.feat_out(zs).view(zs.size(0), -1, self.odim)
      # (B, T_feats//r, r) -> (B, T_feats//r * r)
      logits = self.prob_out(zs).view(zs.size(0), -1)
  
      # postnet -> (B, T_feats//r * r, odim)
      if self.postnet is None:
          after_outs = before_outs
      else:
          after_outs = before_outs + self.postnet(
              before_outs.transpose(1, 2)
          ).transpose(1, 2)
  
      return after_outs, before_outs, logits
  
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 4 for calling the Transformer obj's underlying member method code with example usage: obj._forward(xs, ilens, ys, olens, spembs, sids, lids) and returns: after_outs,  before_outs,  logits