code: def forward_for_export(
      self,
      text,
      batch_lengths,
      speaker_id,
      speaker_id_text,
      speaker_id_attributes,
      pitch,
      pace,
      volume,
  ):
      if self.export_config["enable_ragged_batches"]:
          text, pitch, pace, volume_tensor, lens = batch_from_ragged(
              text,
              pitch,
              pace,
              batch_lengths=batch_lengths,
              padding_idx=self.tokenizer_pad,
              volume=volume,
          )
          if volume is not None:
              volume = volume_tensor
      else:
          lens = batch_lengths.to(dtype=torch.int64)
  
      (mel, n_frames, dur, _, _) = self.model.infer(
          speaker_id,
          text,
          speaker_id_text=speaker_id_text,
          speaker_id_attributes=speaker_id_attributes,
          sigma=0.7,
          f0_mean=0.0,
          f0_std=0.0,
          in_lens=lens,
          pitch_shift=pitch,
          pace=pace,
      ).values()
      ret_values = (mel.float(), n_frames, dur.float())
  
      if volume is not None:
          # Need to reshape as in infer patch
          durs_predicted = dur.float()
          truncated_length = torch.max(lens)
          volume_extended, _ = regulate_len(
              durs_predicted,
              volume[:, :truncated_length].unsqueeze(-1),
              pace[:, :truncated_length],
              group_size=self.model.n_group_size,
              dur_lens=lens,
          )
          volume_extended = volume_extended.squeeze(2).float()
          ret_values = ret_values + (volume_extended,)
      return ret_values
  
imports: import contextlib
  import torch
  from hydra.utils import instantiate
  from omegaconf import DictConfig, OmegaConf
  from pytorch_lightning import Trainer
  from pytorch_lightning.loggers import TensorBoardLogger
  from nemo.collections.common.tokenizers.text_to_speech.tts_tokenizers import BaseTokenizer
  from nemo.collections.tts.losses.radttsloss import AttentionBinarizationLoss, RADTTSLoss
  from nemo.collections.tts.models.base import SpectrogramGenerator
  from nemo.collections.tts.parts.utils.helpers import batch_from_ragged, g2p_backward_compatible_support, plot_alignment_to_numpy, regulate_len, sample_tts_input
  from nemo.core.classes import Exportable
  from nemo.core.classes.common import typecheck
  from nemo.core.neural_types.elements import Index, MelSpectrogramType, RegressionValuesType, TokenDurationType, TokenIndex
  from nemo.core.neural_types.neural_type import NeuralType
  from nemo.core.optim.radam import RAdam
  from nemo.utils import logging
  from nemo.utils.decorators import experimental
label_desc: Use image node_id 22 for calling the RadTTSModel obj's underlying member method code with example usage: obj.forward_for_export(text, batch_lengths, speaker_id, speaker_id_text, speaker_id_attributes, pitch, pace, volume) and returns: ret_values