class_docstr: A greedy CTC decoder.
  
  Provides a common abstraction for sample level and batch level greedy decoding.
  
  Args:
      blank_index: int index of the blank token. Can be 0 or len(vocabulary).
      preserve_alignments: Bool flag which preserves the history of logprobs generated during
          decoding (sample / batched). When set to true, the Hypothesis will contain
          the non-null value for `logprobs` in it. Here, `logprobs` is a torch.Tensors.
      compute_timestamps: A bool flag, which determines whether to compute the character/subword, or
              word based timestamp mapping the output log-probabilities to discrite intervals of timestamps.
              The timestamps will be available in the returned Hypothesis.timestep as a dictionary.
class_docstr_tok: ["A","greedy","CTC","decoder",".","Provides","a","common","abstraction","for","sample","level","and","batch","level","greedy","decoding",".","Args",":","blank_index",":","int","index","of","the","blank","token",".","Can","be","0","or","len","(","vocabulary",")",".","preserve_alignments",":","Bool","flag","which","preserves","the","history","of","logprobs","generated","during","decoding","(","sample","\/","batched",")",".","When","set","to","true",",","the","Hypothesis","will","contain","the","non-null","value","for","`","logprobs","`","in","it",".","Here",",","`","logprobs","`","is","a","torch.Tensors",".","compute_timestamps",":","A","bool","flag",",","which","determines","whether","to","compute","the","character\/subword",",","or","word","based","timestamp","mapping","the","output","log-probabilities","to","discrite","intervals","of","timestamps",".","The","timestamps","will","be","available","in","the","returned","Hypothesis.timestep","as","a","dictionary","."]
docstr: Returns a list of hypotheses given an input batch of the encoder hidden embedding.
  Output token is generated auto-repressively.
  
  Args:
      decoder_output: A tensor of size (batch, timesteps, features).
      decoder_lengths: list of int representing the length of each sequence
          output sequence.
  
  Returns:
      packed list containing batch number of sentences (Hypotheses).
docstr_tok: ["Returns","a","list","of","hypotheses","given","an","input","batch","of","the","encoder","hidden","embedding",".","Output","token","is","generated","auto-repressively",".","Args",":","decoder_output",":","A","tensor","of","size","(","batch",",","timesteps",",","features",")",".","decoder_lengths",":","list","of","int","representing","the","length","of","each","sequence","output","sequence",".","Returns",":","packed","list","containing","batch","number","of","sentences","(","Hypotheses",")","."]
code: def forward(
      self,
      decoder_output: torch.Tensor,
      decoder_lengths: torch.Tensor,
  ) -> Tuple[
      List[Union[rnnt_utils.Hypothesis, rnnt_utils.NBestHypotheses]]
  ]:
      """Returns a list of hypotheses given an input batch of the encoder hidden embedding.
      Output token is generated auto-repressively.
  
      Args:
          decoder_output: A tensor of size (batch, timesteps, features).
          decoder_lengths: list of int representing the length of each sequence
              output sequence.
  
      Returns:
          packed list containing batch number of sentences (Hypotheses).
      """
      if self.vocab is None:
          raise RuntimeError(
              "Please set the vocabulary with `set_vocabulary()` before calling this function."
          )
  
      if self.decoding_type is None:
          raise ValueError(
              "Please set the decoding type with `set_decoding_type()` before calling this function."
          )
  
      with torch.no_grad(), torch.inference_mode():
          # Process each sequence independently
          prediction_tensor = decoder_output
  
          if prediction_tensor.ndim != 3:
              raise ValueError(
                  f"`decoder_output` must be a tensor of shape [B, T, V] (log probs, float). "
                  f"Provided shape = {prediction_tensor.shape}"
              )
  
          # determine type of input - logprobs or labels
          out_len = (
              decoder_lengths if decoder_lengths is not None else None
          )
          hypotheses = self.search_algorithm(prediction_tensor, out_len)
  
          # Pack results into Hypotheses
          packed_result = pack_hypotheses(hypotheses, decoder_lengths)
  
          # Pack the result
          if self.return_best_hypothesis and isinstance(
              packed_result[0], rnnt_utils.NBestHypotheses
          ):
              packed_result = [
                  res.n_best_hypotheses[0] for res in packed_result
              ]  # type: Hypothesis
  
      return (packed_result,)
  
imports: import math
  import os
  from dataclasses import dataclass, field
  from typing import List, Optional, Tuple, Union
  import torch
  from nemo.collections.asr.parts.utils import rnnt_utils
  from nemo.collections.common.tokenizers.tokenizer_spec import TokenizerSpec
  from nemo.core.classes import Typing, typecheck
  from nemo.core.neural_types import HypothesisType, LengthsType, LogprobsType, NeuralType
  from nemo.utils import logging
label_desc: Use image node_id 2 for calling the BeamCTCInfer obj's underlying member method code with example usage: obj.forward(decoder_output, decoder_lengths) and returns: packed_result