class_docstr: Takes model parameters (modelConfig) from config file to initialize radtts module.
  Specify the type of training in the include_modules parameter. "decatnvpred" for decoder training. and "decatnunvbiasdpmvpredapm" for feature training
  n_speakers (int): Number of speakers
  n_speaker_dim (int): number of speakers dimension
  n_text (int): Symbols embedding size
  n_text_dim (int):
  n_flows (int):
  n_conv_layers_per_step (int): number of convolution layers per step
  dummy_speaker_embedding (bool):
  include_modules (string): A string that describes what to train. "decatnvpred" for decoder training. and "decatnunvbiasdpmvpredapm" for feature training.
  scaling_fn (string): scaling function
  decoder_use_partial_padding (Bool): Set this to True to add partial padding
  learn_alignments (Bool): set this to true to learn alignments
  attn_use_CTC (Bool): set True to use CTC
  n_f0_dims (int): number of Pitch dimension
  n_early_size (int):
  n_early_every (int):
  n_group_size (int):
  decoder_use_unvoiced_bias (bool):
  context_lstm_w_f0_and_energy (bool):
  use_first_order_features (bool):
  ap_pred_log_f0 (bool):
  dur_model_config: model configuration for duration
  f0_model_config: model configuration for Pitch
  energy_model_config: model configuration for energy
class_docstr_tok: ["Takes","model","parameters","(","modelConfig",")","from","config","file","to","initialize","radtts","module",".","Specify","the","type","of","training","in","the","include_modules","parameter",".","``","decatnvpred","''","for","decoder","training",".","and","``","decatnunvbiasdpmvpredapm","''","for","feature","training","n_speakers","(","int",")",":","Number","of","speakers","n_speaker_dim","(","int",")",":","number","of","speakers","dimension","n_text","(","int",")",":","Symbols","embedding","size","n_text_dim","(","int",")",":","n_flows","(","int",")",":","n_conv_layers_per_step","(","int",")",":","number","of","convolution","layers","per","step","dummy_speaker_embedding","(","bool",")",":","include_modules","(","string",")",":","A","string","that","describes","what","to","train",".","``","decatnvpred","''","for","decoder","training",".","and","``","decatnunvbiasdpmvpredapm","''","for","feature","training",".","scaling_fn","(","string",")",":","scaling","function","decoder_use_partial_padding","(","Bool",")",":","Set","this","to","True","to","add","partial","padding","learn_alignments","(","Bool",")",":","set","this","to","true","to","learn","alignments","attn_use_CTC","(","Bool",")",":","set","True","to","use","CTC","n_f0_dims","(","int",")",":","number","of","Pitch","dimension","n_early_size","(","int",")",":","n_early_every","(","int",")",":","n_group_size","(","int",")",":","decoder_use_unvoiced_bias","(","bool",")",":","context_lstm_w_f0_and_energy","(","bool",")",":","use_first_order_features","(","bool",")",":","ap_pred_log_f0","(","bool",")",":","dur_model_config",":","model","configuration","for","duration","f0_model_config",":","model","configuration","for","Pitch","energy_model_config",":","model","configuration","for","energy"]
code: def forward(
      self,
      mel,
      speaker_ids,
      text,
      in_lens,
      out_lens,
      binarize_attention=False,
      attn_prior=None,
      f0=None,
      energy_avg=None,
      voiced_mask=None,
  ):
      speaker_vecs = self.encode_speaker(speaker_ids)
      text_enc, text_embeddings = self.encode_text(text, in_lens)
  
      log_s_list, log_det_W_list, z_mel = [], [], []
      attn_hard = None
      if "atn" in self.include_modules or "dec" in self.include_modules:
          # make sure to do the alignments before folding
          attn_mask = ~get_mask_from_lengths(in_lens)[..., None]
          # attn_mask should be 1 for unsd t-steps in text_enc_w_spkvec tensor
          attn_soft, attn_logprob = self.attention(
              mel,
              text_embeddings,
              out_lens,
              attn_mask,
              key_lens=in_lens,
              attn_prior=attn_prior,
          )
  
          if binarize_attention:
              attn = self.binarize_attention(
                  attn_soft, in_lens, out_lens
              )
              attn_hard = attn
          else:
              attn = attn_soft
  
          context = torch.bmm(text_enc, attn.squeeze(1).transpose(1, 2))
      else:
          raise ValueError(
              f"Something unexpected happened. Both 'atn' and 'dec' are not included in 'self.include_modules'. Please double-check."
          )
  
      f0_bias = 0
      # unvoiced bias forward pass
      voiced_mask_bool = voiced_mask.bool()
      if self.use_unvoiced_bias:
          f0_bias = self.unvoiced_bias_module(context.permute(0, 2, 1))
          f0_bias = -f0_bias[..., 0]
          f0_bias.masked_fill_(voiced_mask_bool, 0.0)
  
      # mel decoder forward pass
      if "dec" in self.include_modules:
          if self.n_group_size > 1:
              # might truncate some frames at the end, but that's ok
              # sometimes referred to as the "squeeze" operation
              # invert this by calling self.fold(mel_or_z)
              mel = self.unfold(mel)
          # where context is folded
          # mask f0 in case values are interpolated
          context_w_spkvec = self.preprocess_context(
              context,
              speaker_vecs,
              out_lens,
              f0 * voiced_mask + f0_bias,
              energy_avg,
          )
  
          log_s_list, log_det_W_list, z_out = [], [], []
          unfolded_seq_lens = out_lens // self.n_group_size
          for i, flow_step in enumerate(self.flows):
              if i in self.exit_steps:
                  z = mel[:, : self.n_early_size]
                  z_out.append(z)
                  mel = mel[:, self.n_early_size :]
              mel, log_det_W, log_s = flow_step(
                  mel, context_w_spkvec, seq_lens=unfolded_seq_lens
              )
              log_s_list.append(log_s)
              log_det_W_list.append(log_det_W)
  
          z_out.append(mel)
          z_mel = torch.cat(z_out, 1)
  
      # duration predictor forward pass
      duration_model_outputs = None
      if "dpm" in self.include_modules:
          if attn_hard is None:
              attn_hard = self.binarize_attention(
                  attn_soft, in_lens, out_lens
              )
  
          # convert hard attention to durations
          attn_hard_reduced = attn_hard.sum(2)[:, 0, :]
          duration_model_outputs = self.dur_pred_layer(
              torch.detach(text_enc),
              torch.detach(speaker_vecs),
              torch.detach(attn_hard_reduced.float()),
              in_lens,
          )
  
      # f0, energy, vpred predictors forward pass
      f0_model_outputs = None
      energy_model_outputs = None
      vpred_model_outputs = None
      if "apm" in self.include_modules:
          if attn_hard is None:
              attn_hard = self.binarize_attention(
                  attn_soft, in_lens, out_lens
              )
  
          # convert hard attention to durations
          if binarize_attention:
              text_enc_time_expanded = context.clone()
          else:
              text_enc_time_expanded = torch.bmm(
                  text_enc, attn_hard.squeeze(1).transpose(1, 2)
              )
  
          if self.use_vpred_module:
              # unvoiced bias requires  voiced mask prediction
              vpred_model_outputs = self.v_pred_module(
                  torch.detach(text_enc_time_expanded),
                  torch.detach(speaker_vecs),
                  torch.detach(voiced_mask),
                  out_lens,
              )
  
              # affine transform context using voiced mask
              if self.ap_use_voiced_embeddings:
                  text_enc_time_expanded = (
                      self.apply_voice_mask_to_text(
                          text_enc_time_expanded, voiced_mask
                      )
                  )
          if (
              self.ap_use_unvoiced_bias
          ):  # whether to use the unvoiced bias in the attribute predictor
              f0_target = torch.detach(f0 * voiced_mask + f0_bias)
          else:
              f0_target = torch.detach(f0)
          # fit to log f0 in f0 predictor
          f0_target[voiced_mask_bool] = torch.log(
              f0_target[voiced_mask_bool]
          )
          f0_target = f0_target / 6  # scale to ~ [0, 1] in log space
          energy_avg = energy_avg * 2 - 1  # scale to ~ [-1, 1]
  
          if self.use_first_order_features:
              df0 = self.get_first_order_features(f0_target)
              denergy_avg = self.get_first_order_features(energy_avg)
  
              f0_voiced = torch.cat(
                  (f0_target[:, None], df0[:, None]), dim=1
              )
              energy_avg = torch.cat(
                  (energy_avg[:, None], denergy_avg[:, None]), dim=1
              )
  
              f0_voiced = f0_voiced * 3  # scale to ~ 1 std
              energy_avg = energy_avg * 3  # scale to ~ 1 std
          else:
              f0_voiced = f0_target * 2  # scale to ~ 1 std
              energy_avg = energy_avg * 1.4  # scale to ~ 1 std
          f0_model_outputs = self.f0_pred_module(
              text_enc_time_expanded,
              torch.detach(speaker_vecs),
              f0_voiced,
              out_lens,
          )
  
          energy_model_outputs = self.energy_pred_module(
              text_enc_time_expanded,
              torch.detach(speaker_vecs),
              energy_avg,
              out_lens,
          )
  
      outputs = {
          "z_mel": z_mel,
          "log_det_W_list": log_det_W_list,
          "log_s_list": log_s_list,
          "duration_model_outputs": duration_model_outputs,
          "f0_model_outputs": f0_model_outputs,
          "energy_model_outputs": energy_model_outputs,
          "vpred_model_outputs": vpred_model_outputs,
          "attn_soft": attn_soft,
          "attn": attn,
          "text_embeddings": text_embeddings,
          "attn_logprob": attn_logprob,
      }
  
      return outputs
  
imports: import torch
  import torch.nn.functional
  from torch import nn
  from nemo.collections.tts.modules.attribute_prediction_model import get_attribute_prediction_model
  from nemo.collections.tts.modules.common import AffineTransformationLayer, BiLSTM, ConvAttention, ExponentialClass, Invertible1x1Conv, Invertible1x1ConvLUS, LinearNorm, get_radtts_encoder
  from nemo.collections.tts.parts.utils.helpers import get_mask_from_lengths, mas_width1, regulate_len
  from nemo.core.classes import Exportable, NeuralModule
  from nemo.core.neural_types.elements import Index, LengthsType, MelSpectrogramType, TokenDurationType, TokenIndex
  from nemo.core.neural_types.neural_type import NeuralType
label_desc: Use image node_id 10 for calling the RadTTSModule obj's underlying member method code with example usage: obj.forward(mel, speaker_ids, text, in_lens, out_lens, binarize_attention, attn_prior, f0, energy_avg, voiced_mask) and returns: outputs