class_docstr: Factory class for Speedy Speech encoder enables different encoder types internally.
  
  Args:
      num_chars (int): number of characters.
      out_channels (int): number of output channels.
      in_hidden_channels (int): input and hidden channels. Model keeps the input channels for the intermediate layers.
      encoder_type (str): encoder layer types. 'transformers' or 'residual_conv_bn'. Default 'residual_conv_bn'.
      encoder_params (dict): model parameters for specified encoder type.
      c_in_channels (int): number of channels for conditional input.
  
  Note:
      Default encoder_params to be set in config.json...
  
      ```python
      # for 'relative_position_transformer'
      encoder_params={
          'hidden_channels_ffn': 128,
          'num_heads': 2,
          "kernel_size": 3,
          "dropout_p": 0.1,
          "num_layers": 6,
          "rel_attn_window_size": 4,
          "input_length": None
      },
  
      # for 'residual_conv_bn'
      encoder_params = {
          "kernel_size": 4,
          "dilations": 4 * [1, 2, 4] + [1],
          "num_conv_blocks": 2,
          "num_res_blocks": 13
      }
  
      # for 'fftransformer'
      encoder_params = {
          "hidden_channels_ffn": 1024 ,
          "num_heads": 2,
          "num_layers": 6,
          "dropout_p": 0.1
      }
      ```
docstr: Shapes:
      x: [B, C, T]
      x_mask: [B, 1, T]
      g: [B, C, 1]
docstr_tok: ["Shapes",":","x",":","[","B",",","C",",","T","]","x_mask",":","[","B",",","1",",","T","]","g",":","[","B",",","C",",","1","]"]
code: def forward(
      self, x, x_mask, g=None
  ):  # pylint: disable=unused-argument
      """
      Shapes:
          x: [B, C, T]
          x_mask: [B, 1, T]
          g: [B, C, 1]
      """
      o = self.encoder(x, x_mask)
      return o * x_mask
  
file_path: TTS/TTS/tts/layers/feed_forward/encoder.py
imports: from torch import nn
  from TTS.tts.layers.generic.res_conv_bn import ResidualConv1dBNBlock
  from TTS.tts.layers.generic.transformer import FFTransformerBlock
  from TTS.tts.layers.glow_tts.transformer import RelativePositionTransformer
label_desc: Use image node_id 2 for calling the Encoder obj's underlying member method code with example usage: obj.forward(x, x_mask, g) and returns: unknown