docstr: Helper class to launch the CUDA Kernels to compute Multi-blank Transducer Loss (https://arxiv.org/pdf/2211.03541).
  
  Args:
      sigma: Hyper-parameter related to the logit-normalization method in training multi-blank transducers.
      num_big_blanks: Number of big blank symbols the model has. This should not include the standard blank symbol.
      minibatch: Int representing the batch size.
      maxT: The maximum possible acoustic sequence length. Represents T in the logprobs tensor.
      maxU: The maximum possible target sequence length. Represents U in the logprobs tensor.
      alphabet_size: The vocabulary dimension V + 1 + num-big-blanks
      workspace: An allocated chunk of memory that will be sliced off and reshaped into required
          blocks used as working memory.
      big_blank_workspace: An allocated chunk of memory that will be sliced off and reshaped into required
          blocks used as working memory specifically for the multi-blank related computations.
      blank: Index of the RNNT blank token in the vocabulary. Generally the first or last token in the vocab.
      fastemit_lambda: Float scaling factor for FastEmit regularization. Refer to
          FastEmit: Low-latency Streaming ASR with Sequence-level Emission Regularization.
      clamp: Float value. When set to value >= 0.0, will clamp the gradient to [-clamp, clamp].
      num_threads: Number of OMP threads to launch.
      stream: Numba Cuda Stream.
docstr_tok: ["Helper","class","to","launch","the","CUDA","Kernels","to","compute","Multi-blank","Transducer","Loss","(","https",":","\/\/arxiv.org\/pdf\/2211.03541",")",".","Args",":","sigma",":","Hyper-parameter","related","to","the","logit-normalization","method","in","training","multi-blank","transducers",".","num_big_blanks",":","Number","of","big","blank","symbols","the","model","has",".","This","should","not","include","the","standard","blank","symbol",".","minibatch",":","Int","representing","the","batch","size",".","maxT",":","The","maximum","possible","acoustic","sequence","length",".","Represents","T","in","the","logprobs","tensor",".","maxU",":","The","maximum","possible","target","sequence","length",".","Represents","U","in","the","logprobs","tensor",".","alphabet_size",":","The","vocabulary","dimension","V","+","1","+","num-big-blanks","workspace",":","An","allocated","chunk","of","memory","that","will","be","sliced","off","and","reshaped","into","required","blocks","used","as","working","memory",".","big_blank_workspace",":","An","allocated","chunk","of","memory","that","will","be","sliced","off","and","reshaped","into","required","blocks","used","as","working","memory","specifically","for","the","multi-blank","related","computations",".","blank",":","Index","of","the","RNNT","blank","token","in","the","vocabulary",".","Generally","the","first","or","last","token","in","the","vocab",".","fastemit_lambda",":","Float","scaling","factor","for","FastEmit","regularization",".","Refer","to","FastEmit",":","Low-latency","Streaming","ASR","with","Sequence-level","Emission","Regularization",".","clamp",":","Float","value",".","When","set","to","value",">","=","0.0",",","will","clamp","the","gradient","to","[","-clamp",",","clamp","]",".","num_threads",":","Number","of","OMP","threads","to","launch",".","stream",":","Numba","Cuda","Stream","."]
code: def __init__(
      self,
      sigma: float,
      num_big_blanks: int,
      minibatch: int,
      maxT: int,
      maxU: int,
      alphabet_size: int,
      workspace,
      big_blank_workspace,
      blank: int,
      fastemit_lambda: float,
      clamp: float,
      num_threads: int,
      stream,
  ):
      """
      Helper class to launch the CUDA Kernels to compute Multi-blank Transducer Loss (https://arxiv.org/pdf/2211.03541).
  
      Args:
          sigma: Hyper-parameter related to the logit-normalization method in training multi-blank transducers.
          num_big_blanks: Number of big blank symbols the model has. This should not include the standard blank symbol.
          minibatch: Int representing the batch size.
          maxT: The maximum possible acoustic sequence length. Represents T in the logprobs tensor.
          maxU: The maximum possible target sequence length. Represents U in the logprobs tensor.
          alphabet_size: The vocabulary dimension V + 1 + num-big-blanks
          workspace: An allocated chunk of memory that will be sliced off and reshaped into required
              blocks used as working memory.
          big_blank_workspace: An allocated chunk of memory that will be sliced off and reshaped into required
              blocks used as working memory specifically for the multi-blank related computations.
          blank: Index of the RNNT blank token in the vocabulary. Generally the first or last token in the vocab.
          fastemit_lambda: Float scaling factor for FastEmit regularization. Refer to
              FastEmit: Low-latency Streaming ASR with Sequence-level Emission Regularization.
          clamp: Float value. When set to value >= 0.0, will clamp the gradient to [-clamp, clamp].
          num_threads: Number of OMP threads to launch.
          stream: Numba Cuda Stream.
      """
      super().__init__(
          minibatch,
          maxT,
          maxU,
          alphabet_size,
          workspace,
          blank,
          fastemit_lambda,
          clamp,
          num_threads,
          stream,
      )
      self.big_blank_workspace = cuda.as_cuda_array(
          big_blank_workspace
      )  # a flat vector of integer numbers that represents allocated memory slices
  
      self.num_big_blanks = num_big_blanks
      self.sigma = sigma
  
imports: import multiprocessing
  import random
  from typing import Optional, Tuple
  import numba
  import torch
  from numba import cuda
  from nemo.collections.asr.parts.numba.rnnt_loss.utils import global_constants, rnnt_helper
  from nemo.collections.asr.parts.numba.rnnt_loss.utils.cuda_utils import gpu_rnnt_kernel, reduce
label_desc: Use image node_id 1 to create a new MultiblankGPURNNT object from inherited base classes: GPURNNT with example: obj = MultiblankGPURNNT(sigma, num_big_blanks, minibatch, maxT, maxU, alphabet_size, workspace, big_blank_workspace, blank, fastemit_lambda, clamp, num_threads, stream)