docstr: Helper class to launch the CUDA Kernels to compute the Transducer Loss.
  
  Args:
      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 (inclusive of RNNT blank).
      workspace: An allocated chunk of memory that will be sliced off and
          reshaped into required blocks used as working memory.
      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","the","Transducer","Loss",".","Args",":","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","(","inclusive","of","RNNT","blank",")",".","workspace",":","An","allocated","chunk","of","memory","that","will","be","sliced","off","and","reshaped","into","required","blocks","used","as","working","memory",".","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,
      minibatch: int,
      maxT: int,
      maxU: int,
      alphabet_size: int,
      workspace,
      blank: int,
      fastemit_lambda: float,
      clamp: float,
      num_threads: int,
      stream,
  ):
      """
      Helper class to launch the CUDA Kernels to compute the Transducer Loss.
  
      Args:
          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 (inclusive of RNNT blank).
          workspace: An allocated chunk of memory that will be sliced off and
              reshaped into required blocks used as working memory.
          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.
      """
  
      self.minibatch_ = minibatch
      self.maxT_ = maxT
      self.maxU_ = maxU
      self.alphabet_size_ = alphabet_size
      self.gpu_workspace = cuda.as_cuda_array(
          workspace
      )  # a flat vector of floatX numbers that represents allocated memory slices
      self.blank_ = blank
      self.fastemit_lambda_ = fastemit_lambda
      self.clamp_ = abs(clamp)
      self.num_threads_ = num_threads
      self.stream_ = stream  # type: cuda.cudadrv.driver.Stream
  
      if num_threads > 0:
          numba.set_num_threads(
              min(multiprocessing.cpu_count(), num_threads)
          )
          self.num_threads_ = numba.get_num_threads()
      else:
          self.num_threads_ = numba.get_num_threads()
  
imports: import multiprocessing
  from typing import Optional, Tuple
  import numba
  import torch
  from numba import cuda
  from espnet2.asr.transducer.rnnt_multi_blank.utils import global_constants, rnnt_helper
  from espnet2.asr.transducer.rnnt_multi_blank.utils.cuda_utils import gpu_rnnt_kernel, reduce
label_desc: Use image node_id 1 to create a new GPURNNT object  with example: obj = GPURNNT(minibatch, maxT, maxU, alphabet_size, workspace, blank, fastemit_lambda, clamp, num_threads, stream)