class_docstr: Speedy Speech model
  https://arxiv.org/abs/2008.03802
  
  Encoder -> DurationPredictor -> Decoder
  
  This model is able to achieve a reasonable performance with only
  ~3M model parameters and convolutional layers.
  
  This model requires precomputed phoneme durations to train a duration predictor. At inference
  it only uses the duration predictor to compute durations and expand encoder outputs respectively.
  
  Args:
      num_chars (int): number of unique input to characters
      out_channels (int): number of output tensor channels. It is equal to the expected spectrogram size.
      hidden_channels (int): number of channels in all the model layers.
      positional_encoding (bool, optional): enable/disable Positional encoding on encoder outputs. Defaults to True.
      length_scale (int, optional): coefficient to set the speech speed. <1 slower, >1 faster. Defaults to 1.
      encoder_type (str, optional): set the encoder type. Defaults to 'residual_conv_bn'.
      encoder_params (dict, optional): set encoder parameters depending on 'encoder_type'. Defaults to { "kernel_size": 4, "dilations": 4 * [1, 2, 4] + [1], "num_conv_blocks": 2, "num_res_blocks": 13 }.
      decoder_type (str, optional): decoder type. Defaults to 'residual_conv_bn'.
      decoder_params (dict, optional): set decoder parameters depending on 'decoder_type'. Defaults to { "kernel_size": 4, "dilations": 4 * [1, 2, 4, 8] + [1], "num_conv_blocks": 2, "num_res_blocks": 17 }.
      num_speakers (int, optional): number of speakers for multi-speaker training. Defaults to 0.
      external_c (bool, optional): enable external speaker embeddings. Defaults to False.
      c_in_channels (int, optional): number of channels in speaker embedding vectors. Defaults to 0.
class_docstr_tok: ["Speedy","Speech","model","https",":","\/\/arxiv.org\/abs\/2008.03802","Encoder","-",">","DurationPredictor","-",">","Decoder","This","model","is","able","to","achieve","a","reasonable","performance","with","only","~3M","model","parameters","and","convolutional","layers",".","This","model","requires","precomputed","phoneme","durations","to","train","a","duration","predictor",".","At","inference","it","only","uses","the","duration","predictor","to","compute","durations","and","expand","encoder","outputs","respectively",".","Args",":","num_chars","(","int",")",":","number","of","unique","input","to","characters","out_channels","(","int",")",":","number","of","output","tensor","channels",".","It","is","equal","to","the","expected","spectrogram","size",".","hidden_channels","(","int",")",":","number","of","channels","in","all","the","model","layers",".","positional_encoding","(","bool",",","optional",")",":","enable\/disable","Positional","encoding","on","encoder","outputs",".","Defaults","to","True",".","length_scale","(","int",",","optional",")",":","coefficient","to","set","the","speech","speed",".","<","1","slower",",",">","1","faster",".","Defaults","to","1.","encoder_type","(","str",",","optional",")",":","set","the","encoder","type",".","Defaults","to","'residual_conv_bn","'",".","encoder_params","(","dict",",","optional",")",":","set","encoder","parameters","depending","on","'encoder_type","'",".","Defaults","to","{","``","kernel_size","''",":","4",",","``","dilations","''",":","4","*","[","1",",","2",",","4","]","+","[","1","]",",","``","num_conv_blocks","''",":","2",",","``","num_res_blocks","''",":","13","}",".","decoder_type","(","str",",","optional",")",":","decoder","type",".","Defaults","to","'residual_conv_bn","'",".","decoder_params","(","dict",",","optional",")",":","set","decoder","parameters","depending","on","'decoder_type","'",".","Defaults","to","{","``","kernel_size","''",":","4",",","``","dilations","''",":","4","*","[","1",",","2",",","4",",","8","]","+","[","1","]",",","``","num_conv_blocks","''",":","2",",","``","num_res_blocks","''",":","17","}",".","num_speakers","(","int",",","optional",")",":","number","of","speakers","for","multi-speaker","training",".","Defaults","to","0.","external_c","(","bool",",","optional",")",":","enable","external","speaker","embeddings",".","Defaults","to","False",".","c_in_channels","(","int",",","optional",")",":","number","of","channels","in","speaker","embedding","vectors",".","Defaults","to","0","."]
docstr: Shapes:
      x: [B, T_max]
      x_lengths: [B]
      y_lengths: [B]
      dr: [B, T_max]
      g: [B, C]
docstr_tok: ["Shapes",":","x",":","[","B",",","T_max","]","x_lengths",":","[","B","]","y_lengths",":","[","B","]","dr",":","[","B",",","T_max","]","g",":","[","B",",","C","]"]
code: def forward(
      self, x, x_lengths, y_lengths, dr, g=None
  ):  # pylint: disable=unused-argument
      """
      Shapes:
          x: [B, T_max]
          x_lengths: [B]
          y_lengths: [B]
          dr: [B, T_max]
          g: [B, C]
      """
      o_en, o_en_dp, x_mask, g = self._forward_encoder(x, x_lengths, g)
      o_dr_log = self.duration_predictor(o_en_dp.detach(), x_mask)
      o_de, attn = self._forward_decoder(
          o_en, o_en_dp, dr, x_mask, y_lengths, g=g
      )
      return o_de, o_dr_log.squeeze(1), attn
  
file_path: TTS/TTS/tts/models/speedy_speech.py
imports: import torch
  from torch import nn
  from TTS.tts.layers.speedy_speech.decoder import Decoder
  from TTS.tts.layers.speedy_speech.duration_predictor import DurationPredictor
  from TTS.tts.layers.speedy_speech.encoder import Encoder, PositionalEncoding
  from TTS.tts.utils.generic_utils import sequence_mask
  from TTS.tts.layers.glow_tts.monotonic_align import generate_path
label_desc: Use image node_id 8 for calling the SpeedySpeech obj's underlying member method code with example usage: obj.forward(x, x_lengths, y_lengths, dr, g) and returns: o_de,  o_dr_log,  attn