class_docstr: Base class for encoder decoder RNNT-based models.
class_docstr_tok: ["Base","class","for","encoder","decoder","RNNT-based","models","."]
code: def on_after_backward(self):
      super().on_after_backward()
      if (
          self._optim_variational_noise_std > 0
          and self.global_step >= self._optim_variational_noise_start
      ):
          for param_name, param in self.decoder.named_parameters():
              if param.grad is not None:
                  noise = torch.normal(
                      mean=0.0,
                      std=self._optim_variational_noise_std,
                      size=param.size(),
                      device=param.device,
                      dtype=param.dtype,
                  )
                  param.grad.data.add_(noise)
  
      if self._optim_normalize_joint_txu:
          T, U = self._optim_normalize_txu
          if T is not None and U is not None:
              for param_name, param in self.encoder.named_parameters():
                  if param.grad is not None:
                      param.grad.data.div_(U)
  
              for param_name, param in self.decoder.named_parameters():
                  if param.grad is not None:
                      param.grad.data.div_(T)
  
      if self._optim_normalize_encoder_norm:
          for param_name, param in self.encoder.named_parameters():
              if param.grad is not None:
                  norm = param.grad.norm()
                  param.grad.data.div_(norm)
  
      if self._optim_normalize_decoder_norm:
          for param_name, param in self.decoder.named_parameters():
              if param.grad is not None:
                  norm = param.grad.norm()
                  param.grad.data.div_(norm)
  
      if self._optim_normalize_joint_norm:
          for param_name, param in self.joint.named_parameters():
              if param.grad is not None:
                  norm = param.grad.norm()
                  param.grad.data.div_(norm)
  
imports: import copy
  import json
  import os
  import tempfile
  from math import ceil
  from typing import Dict, List, Optional, Tuple, Union
  import torch
  from omegaconf import DictConfig, OmegaConf, open_dict
  from pytorch_lightning import Trainer
  from tqdm.auto import tqdm
  from nemo.collections.asr.data import audio_to_text_dataset
  from nemo.collections.asr.data.audio_to_text_dali import AudioToCharDALIDataset, DALIOutputs
  from nemo.collections.asr.data.audio_to_text_lhotse import LhotseSpeechToTextBpeDataset
  from nemo.collections.asr.losses.rnnt import RNNTLoss, resolve_rnnt_default_loss_name
  from nemo.collections.asr.metrics.wer import WER
  from nemo.collections.asr.models.asr_model import ASRModel, ExportableEncDecModel
  from nemo.collections.asr.modules.rnnt import RNNTDecoderJoint
  from nemo.collections.asr.parts.mixins import ASRModuleMixin
  from nemo.collections.asr.parts.submodules.rnnt_decoding import RNNTDecoding, RNNTDecodingConfig
  from nemo.collections.asr.parts.utils.audio_utils import ChannelSelectorType
  from nemo.collections.common.data.lhotse import get_lhotse_dataloader_from_config
  from nemo.collections.common.parts.preprocessing.parsers import make_parser
  from nemo.core.classes.common import PretrainedModelInfo, typecheck
  from nemo.core.classes.mixins import AccessMixin
  from nemo.core.neural_types import AcousticEncodedRepresentation, AudioSignal, LengthsType, NeuralType, SpectrogramType
  from nemo.utils import logging
label_desc: Use image node_id 22 for calling the EncDecRNNTModel obj's underlying member method code with example usage: obj.on_after_backward() without return types