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 infer(
      self,
      speaker_id,
      text,
      sigma=0.7,
      speaker_id_text=None,
      speaker_id_attributes=None,
      pace=None,
      token_duration_max=100,
      in_lens=None,
      dur=None,
      f0=None,
      f0_mean=0.0,
      f0_std=0.0,
      energy_avg=None,
      voiced_mask=None,
      pitch_shift=None,
  ):
      batch_size = text.shape[0]
      if in_lens is None:
          in_lens = (
              text.new_ones((batch_size,), dtype=torch.int64)
              * text.shape[1]
          )
          txt_len_pad_removed = text.shape[1]
      else:
          txt_len_pad_removed = torch.max(in_lens)
          # borisf : this should not be needed as long as we have properly formed input batch
          text = text[:, :txt_len_pad_removed]
  
      spk_vec = self.encode_speaker(speaker_id)
  
      if speaker_id_text is None:
          speaker_id_text = speaker_id
      if speaker_id_attributes is None:
          speaker_id_attributes = speaker_id
      spk_vec_text = self.encode_speaker(speaker_id_text)
      spk_vec_attributes = self.encode_speaker(speaker_id_attributes)
      txt_enc, _ = self.encode_text(text, in_lens)
  
      if dur is None:
          # get token durations
          dur = self.dur_pred_layer.infer(
              txt_enc, spk_vec_text, lens=in_lens
          )
          dur = pad_dur(dur, txt_enc)
          dur = dur[:, 0]
          dur = dur.clamp(0, token_duration_max)
  
      if pace is None:
          pace = txt_enc.new_ones((batch_size, txt_len_pad_removed))
      else:
          pace = pace[:, :txt_len_pad_removed]
  
      txt_enc_time_expanded, out_lens = regulate_len(
          dur,
          txt_enc.transpose(1, 2),
          pace,
          group_size=self.n_group_size,
          dur_lens=in_lens,
      )
      n_groups = torch.div(
          out_lens, self.n_group_size, rounding_mode="floor"
      )
      max_out_len = torch.max(out_lens)
  
      txt_enc_time_expanded.transpose_(1, 2)
      if voiced_mask is None:
          if self.use_vpred_module:
              # get logits
              voiced_mask = self.v_pred_module.infer(
                  txt_enc_time_expanded,
                  spk_vec_attributes,
                  lens=out_lens,
              )
              voiced_mask_bool = (
                  torch.sigmoid(voiced_mask[:, 0])
                  > self.v_pred_threshold
              )
              voiced_mask = voiced_mask_bool.to(dur.dtype)
          else:
              voiced_mask_bool = None
      else:
          voiced_mask_bool = voiced_mask.bool()
  
      ap_txt_enc_time_expanded = txt_enc_time_expanded
      # voice mask augmentation only used for attribute prediction
      if self.ap_use_voiced_embeddings:
          ap_txt_enc_time_expanded = self.apply_voice_mask_to_text(
              txt_enc_time_expanded, voiced_mask
          )
  
      f0_bias = 0
      # unvoiced bias forward pass
      if self.use_unvoiced_bias:
          f0_bias = self.unvoiced_bias_module(
              txt_enc_time_expanded.permute(0, 2, 1)
          )
          f0_bias = -f0_bias[..., 0]
  
      if f0 is None:
          f0 = self.infer_f0(
              ap_txt_enc_time_expanded,
              spk_vec_attributes,
              voiced_mask_bool,
              out_lens,
          )[:, 0]
  
      f0 = adjust_f0(
          f0, f0_mean, f0_std, voiced_mask_bool, musical_scaling=False
      )
  
      if energy_avg is None:
          energy_avg = self.infer_energy(
              ap_txt_enc_time_expanded, spk_vec, out_lens
          )[:, 0]
  
      # replication pad, because ungrouping with different group sizes
      # may lead to mismatched lengths
      # FIXME: use replication pad
      (energy_avg, f0) = pad_energy_avg_and_f0(
          energy_avg, f0, max_out_len
      )
  
      if pitch_shift is not None:
          pitch_shift_spec_len, _ = regulate_len(
              dur,
              pitch_shift[:, :txt_len_pad_removed].unsqueeze(-1),
              pace,
              group_size=self.n_group_size,
              dur_lens=in_lens,
          )
          f0_bias = pitch_shift_spec_len.squeeze(-1) + f0_bias
  
      context_w_spkvec = self.preprocess_context(
          txt_enc_time_expanded,
          spk_vec,
          out_lens,
          (f0 + f0_bias) * voiced_mask,
          energy_avg,
          assume_padded=True,
      )
  
      residual = txt_enc.new_zeros(
          batch_size, 80 * self.n_group_size, torch.max(n_groups)
      )
      if sigma > 0.0:
          residual = torch.normal(residual) * sigma
  
      # map from z sample to data
      num_steps_to_exit = len(self.exit_steps)
      split = num_steps_to_exit * self.n_early_size
      mel = residual[:, split:]
      residual = residual[:, :split]
  
      for i, flow_step in enumerate(reversed(self.flows)):
          curr_step = self.n_flows - i - 1
          mel = flow_step(
              mel, context_w_spkvec, inverse=True, seq_lens=n_groups
          )
          if (
              num_steps_to_exit > 0
              and curr_step == self.exit_steps[num_steps_to_exit - 1]
          ):
              # concatenate the next chunk of z
              num_steps_to_exit = num_steps_to_exit - 1
              split = num_steps_to_exit * self.n_early_size
              residual_to_add = residual[:, split:]
              residual = residual[:, :split]
              mel = torch.cat((residual_to_add, mel), 1)
  
      if self.n_group_size > 1:
          mel = self.fold(mel)
  
      return {
          "mel": mel,
          "out_lens": out_lens,
          "dur": dur,
          "f0": f0,
          "energy_avg": energy_avg,
      }
  
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 11 for calling the RadTTSModule obj's underlying member method code with example usage: obj.infer(speaker_id, text, sigma, speaker_id_text, speaker_id_attributes, pace, token_duration_max, in_lens, dur, f0, f0_mean, f0_std, energy_avg, voiced_mask, pitch_shift) and returns: dict