docstr: TODO: handle multi-speaker
  Shapes:
      - x: :math:`[B, C, T]`
      - mask:  :math:`[B, 1, T] or [B, T]`
docstr_tok: ["TODO",":","handle","multi-speaker","Shapes",":","-","x",":",":","math",":","`","[","B",",","C",",","T","]","`","-","mask",":",":","math",":","`","[","B",",","1",",","T","]","or","[","B",",","T","]","`"]
code: def forward(
      self, x, mask=None, g=None
  ):  # pylint: disable=unused-argument
      """
      TODO: handle multi-speaker
      Shapes:
          - x: :math:`[B, C, T]`
          - mask:  :math:`[B, 1, T] or [B, T]`
      """
      if mask is not None and mask.ndim == 3:
          mask = mask.squeeze(1)
          # mask is negated, torch uses 1s and 0s reversely.
          mask = ~mask.bool()
      alignments = []
      for layer in self.fft_layers:
          x, align = layer(x, src_key_padding_mask=mask)
          alignments.append(align.unsqueeze(1))
      alignments = torch.cat(alignments, 1)
      return x
  
file_path: TTS/TTS/tts/layers/generic/transformer.py
imports: import torch
  import torch.nn.functional
  from torch import nn
label_desc: Use image node_id 2 for calling the FFTransformerBlock obj's underlying member method code with example usage: obj.forward(x, mask, g) and returns: x