docstr: Utility method to enable calculation of auxiliary losses for ASR training.
  
  Args:
      loss: The output loss value prior to addition with auxiliary losses.
      reset_registry: Bool, whether to reset the AccessMixin registry after adding auxiliary losses.
  
  Returns:
      Loss tensor used for back propagation.
docstr_tok: ["Utility","method","to","enable","calculation","of","auxiliary","losses","for","ASR","training",".","Args",":","loss",":","The","output","loss","value","prior","to","addition","with","auxiliary","losses",".","reset_registry",":","Bool",",","whether","to","reset","the","AccessMixin","registry","after","adding","auxiliary","losses",".","Returns",":","Loss","tensor","used","for","back","propagation","."]
code: def add_auxiliary_losses(
      self, loss: torch.Tensor, reset_registry: bool = False
  ) -> torch.Tensor:
      """
      Utility method to enable calculation of auxiliary losses for ASR training.
  
      Args:
          loss: The output loss value prior to addition with auxiliary losses.
          reset_registry: Bool, whether to reset the AccessMixin registry after adding auxiliary losses.
  
      Returns:
          Loss tensor used for back propagation.
      """
      # Add adapter auxiliary losses, if registered
      if AccessMixin.is_access_enabled():
          registry = AccessMixin.get_module_registry(self)
          log_dict = {}
  
          for loss_key, loss_registry in registry.items():
              # Add auxiliary loss to total loss
              if "adapter_loss" in loss_registry:
                  loss_list = loss_registry["adapter_loss"]
                  loss_value = sum(loss_list)
                  loss += loss_value
  
                  # Log current loss name and value
                  keys = loss_key.split(".")
                  key = "/".join(keys)
                  key = "adapter_loss/" + key
                  log_dict[key] = loss_value.detach()
  
          if len(log_dict) > 0:
              self.log_dict(log_dict)
  
      if reset_registry:
          AccessMixin.reset_registry(self)
  
      # return total loss
      return loss
  
imports: import logging
  from abc import ABC, abstractmethod
  from typing import List
  import torch
  from nemo.core.classes import ModelPT
  from nemo.core.classes.common import PretrainedModelInfo
  from nemo.core.classes.exportable import Exportable
  from nemo.core.classes.mixins import AccessMixin
  from nemo.core.utils.neural_type_utils import get_io_names
  from nemo.utils import logging, model_utils
  from nemo.utils.cast_utils import cast_all
label_desc: Use image node_id 5 for calling the ASRModel obj's underlying member method code with example usage: obj.add_auxiliary_losses(loss, reset_registry) and returns: loss