class_docstr: k2 Mixin class that simplifies the construction of various k2-based CTC-like losses.
  
  It does the following:
      -   Prepares and adapts the input tensors (method _prepare_log_probs_and_targets).
      -   Creates Emissions graphs (method _prepare_emissions_graphs).
      -   Extracts the labels and probabilities of the best lattice path (method _extract_labels_and_probabilities).
class_docstr_tok: ["k2","Mixin","class","that","simplifies","the","construction","of","various","k2-based","CTC-like","losses",".","It","does","the","following",":","-","Prepares","and","adapts","the","input","tensors","(","method","_prepare_log_probs_and_targets",")",".","-","Creates","Emissions","graphs","(","method","_prepare_emissions_graphs",")",".","-","Extracts","the","labels","and","probabilities","of","the","best","lattice","path","(","method","_extract_labels_and_probabilities",")","."]
docstr: PyTorch is doing the log-softmax normalization as part of the CTC computation.
  More: https://github.com/k2-fsa/k2/issues/575
docstr_tok: ["PyTorch","is","doing","the","log-softmax","normalization","as","part","of","the","CTC","computation",".","More",":","https",":","\/\/github.com\/k2-fsa\/k2\/issues\/575"]
code: def _maybe_normalize_gradients(
      self, log_probs: torch.Tensor, input_lengths: torch.Tensor
  ) -> torch.Tensor:
      """PyTorch is doing the log-softmax normalization as part of the CTC computation.
      More: https://github.com/k2-fsa/k2/issues/575
      """
      return GradExpNormalize.apply(
          log_probs,
          input_lengths,
          "mean" if self.reduction != "sum" else "none",
      )
  
file_path: NeMo/nemo/collections/asr/parts/k2/loss_mixins.py
imports: from abc import ABC
  from typing import List, Optional, Tuple
  import torch
  from nemo.collections.asr.parts.k2.grad_utils import GradExpNormalize
  from nemo.collections.asr.parts.k2.utils import create_supervision, get_arc_weights, get_uniform_rnnt_prune_ranges, make_non_pad_mask, make_non_pad_mask_3d, prep_padded_densefsavec
  from nemo.core.utils.k2_guard import k2
label_desc: Use image node_id 3 for calling the CtcK2Mixin obj's underlying member method code with example usage: obj._maybe_normalize_gradients(log_probs, input_lengths) and returns: GradExpNormalize