class_docstr: A Hybrid Autoregressive Transducer Joint Network (HAT Joint Network).
  A HAT Joint network, comprised of a feedforward model.
  
  Args:
      jointnet: A dict-like object which contains the following key-value pairs.
          encoder_hidden: int specifying the hidden dimension of the encoder net.
          pred_hidden: int specifying the hidden dimension of the prediction net.
          joint_hidden: int specifying the hidden dimension of the joint net
          activation: Activation function used in the joint step. Can be one of
              ['relu', 'tanh', 'sigmoid'].
  
          Optionally, it may also contain the following:
          dropout: float, set to 0.0 by default. Optional dropout applied at the end of the joint net.
  
      num_classes: int, specifying the vocabulary size that the joint network must predict,
          excluding the HAT blank token.
  
      vocabulary: Optional list of strings/tokens that comprise the vocabulary of the joint network.
          Unused and kept only for easy access for character based encoding HAT models.
  
      log_softmax: Optional bool, set to None by default. If set as None, will compute the log_softmax()
          based on the value provided.
  
      preserve_memory: Optional bool, set to False by default. If the model crashes due to the memory
          intensive joint step, one might try this flag to empty the tensor cache in pytorch.
  
          Warning: This will make the forward-backward pass much slower than normal.
          It also might not fix the OOM if the GPU simply does not have enough memory to compute the joint.
  
      fuse_loss_wer: Optional bool, set to False by default.
  
          Fuses the joint forward, loss forward and
          wer forward steps. In doing so, it trades of speed for memory conservation by creating sub-batches
          of the provided batch of inputs, and performs Joint forward, loss forward and wer forward (optional),
          all on sub-batches, then collates results to be exactly equal to results from the entire batch.
  
          When this flag is set, prior to calling forward, the fields `loss` and `wer` (either one) *must*
          be set using the `HATJoint.set_loss()` or `HATJoint.set_wer()` methods.
  
          Further, when this flag is set, the following argument `fused_batch_size` *must* be provided
          as a non negative integer. This value refers to the size of the sub-batch.
  
          When the flag is set, the input and output signature of `forward()` of this method changes.
          Input - in addition to `encoder_outputs` (mandatory argument), the following arguments can be provided.
              - decoder_outputs (optional). Required if loss computation is required.
              - encoder_lengths (required)
              - transcripts (optional). Required for wer calculation.
              - transcript_lengths (optional). Required for wer calculation.
              - compute_wer (bool, default false). Whether to compute WER or not for the fused batch.
  
          Output - instead of the usual `joint` log prob tensor, the following results can be returned.
              - loss (optional). Returned if decoder_outputs, transcripts and transript_lengths are not None.
              - wer_numerator + wer_denominator (optional). Returned if transcripts, transcripts_lengths are provided
                  and compute_wer is set.
  
      fused_batch_size: Optional int, required if `fuse_loss_wer` flag is set. Determines the size of the
          sub-batches. Should be any value below the actual batch size per GPU.
class_docstr_tok: ["A","Hybrid","Autoregressive","Transducer","Joint","Network","(","HAT","Joint","Network",")",".","A","HAT","Joint","network",",","comprised","of","a","feedforward","model",".","Args",":","jointnet",":","A","dict-like","object","which","contains","the","following","key-value","pairs",".","encoder_hidden",":","int","specifying","the","hidden","dimension","of","the","encoder","net",".","pred_hidden",":","int","specifying","the","hidden","dimension","of","the","prediction","net",".","joint_hidden",":","int","specifying","the","hidden","dimension","of","the","joint","net","activation",":","Activation","function","used","in","the","joint","step",".","Can","be","one","of","[","'relu","'",",","'tanh","'",",","'sigmoid","'","]",".","Optionally",",","it","may","also","contain","the","following",":","dropout",":","float",",","set","to","0.0","by","default",".","Optional","dropout","applied","at","the","end","of","the","joint","net",".","num_classes",":","int",",","specifying","the","vocabulary","size","that","the","joint","network","must","predict",",","excluding","the","HAT","blank","token",".","vocabulary",":","Optional","list","of","strings\/tokens","that","comprise","the","vocabulary","of","the","joint","network",".","Unused","and","kept","only","for","easy","access","for","character","based","encoding","HAT","models",".","log_softmax",":","Optional","bool",",","set","to","None","by","default",".","If","set","as","None",",","will","compute","the","log_softmax","(",")","based","on","the","value","provided",".","preserve_memory",":","Optional","bool",",","set","to","False","by","default",".","If","the","model","crashes","due","to","the","memory","intensive","joint","step",",","one","might","try","this","flag","to","empty","the","tensor","cache","in","pytorch",".","Warning",":","This","will","make","the","forward-backward","pass","much","slower","than","normal",".","It","also","might","not","fix","the","OOM","if","the","GPU","simply","does","not","have","enough","memory","to","compute","the","joint",".","fuse_loss_wer",":","Optional","bool",",","set","to","False","by","default",".","Fuses","the","joint","forward",",","loss","forward","and","wer","forward","steps",".","In","doing","so",",","it","trades","of","speed","for","memory","conservation","by","creating","sub-batches","of","the","provided","batch","of","inputs",",","and","performs","Joint","forward",",","loss","forward","and","wer","forward","(","optional",")",",","all","on","sub-batches",",","then","collates","results","to","be","exactly","equal","to","results","from","the","entire","batch",".","When","this","flag","is","set",",","prior","to","calling","forward",",","the","fields","`","loss","`","and","`","wer","`","(","either","one",")","*","must","*","be","set","using","the","`","HATJoint.set_loss","(",")","`","or","`","HATJoint.set_wer","(",")","`","methods",".","Further",",","when","this","flag","is","set",",","the","following","argument","`","fused_batch_size","`","*","must","*","be","provided","as","a","non","negative","integer",".","This","value","refers","to","the","size","of","the","sub-batch",".","When","the","flag","is","set",",","the","input","and","output","signature","of","`","forward","(",")","`","of","this","method","changes",".","Input","-","in","addition","to","`","encoder_outputs","`","(","mandatory","argument",")",",","the","following","arguments","can","be","provided",".","-","decoder_outputs","(","optional",")",".","Required","if","loss","computation","is","required",".","-","encoder_lengths","(","required",")","-","transcripts","(","optional",")",".","Required","for","wer","calculation",".","-","transcript_lengths","(","optional",")",".","Required","for","wer","calculation",".","-","compute_wer","(","bool",",","default","false",")",".","Whether","to","compute","WER","or","not","for","the","fused","batch",".","Output","-","instead","of","the","usual","`","joint","`","log","prob","tensor",",","the","following","results","can","be","returned",".","-","loss","(","optional",")",".","Returned","if","decoder_outputs",",","transcripts","and","transript_lengths","are","not","None",".","-","wer_numerator","+","wer_denominator","(","optional",")",".","Returned","if","transcripts",",","transcripts_lengths","are","provided","and","compute_wer","is","set",".","fused_batch_size",":","Optional","int",",","required","if","`","fuse_loss_wer","`","flag","is","set",".","Determines","the","size","of","the","sub-batches",".","Should","be","any","value","below","the","actual","batch","size","per","GPU","."]
code: def return_hat_ilm(self, hat_subtract_ilm):
      self._return_hat_ilm = hat_subtract_ilm
  
file_path: NeMo/nemo/collections/asr/modules/hybrid_autoregressive_transducer.py
imports: from typing import Any, Dict, List, Optional, Tuple, Union
  import torch
  from nemo.collections.asr.modules import rnnt
  from nemo.collections.asr.parts.utils.rnnt_utils import HATJointOutput
  from nemo.utils import logging
label_desc: Use image node_id 3 for calling the HATJoint obj's underlying member method code with example usage: obj.return_hat_ilm(hat_subtract_ilm) without return types