class_docstr: CUDA CTC beam search decoder.
  
  .. devices:: CUDA
  
  Note:
      To build the decoder, please use the factory function :func:`cuda_ctc_decoder`.
docstr: Args:
      blank_id (int): token id corresopnding to blank, only support 0 for now. (Default: 0)
      vocab_list (List[str]): list of vocabulary tokens
      beam_size (int, optional): max number of hypos to hold after each decode step (Default: 10)
      nbest (int): number of best decodings to return
      blank_skip_threshold (float):
          skip frames if log_prob(blank) > log(blank_skip_threshold), to speed up decoding.
          (Default: 0.95).
      cuda_stream (torch.cuda.streams.Stream): using assigned cuda stream (Default: using default stream)
docstr_tok: ["Args",":","blank_id","(","int",")",":","token","id","corresopnding","to","blank",",","only","support","0","for","now",".","(","Default",":","0",")","vocab_list","(","List","[","str","]",")",":","list","of","vocabulary","tokens","beam_size","(","int",",","optional",")",":","max","number","of","hypos","to","hold","after","each","decode","step","(","Default",":","10",")","nbest","(","int",")",":","number","of","best","decodings","to","return","blank_skip_threshold","(","float",")",":","skip","frames","if","log_prob","(","blank",")",">","log","(","blank_skip_threshold",")",",","to","speed","up","decoding",".","(","Default",":","0.95",")",".","cuda_stream","(","torch.cuda.streams.Stream",")",":","using","assigned","cuda","stream","(","Default",":","using","default","stream",")"]
code: def __init__(
      self,
      vocab_list: List[str],
      blank_id: int = 0,
      beam_size: int = 10,
      nbest: int = 1,
      blank_skip_threshold: float = _DEFAULT_BLANK_SKIP_THREASHOLD,
      cuda_stream: torch.cuda.streams.Stream = None,
  ):
      """
      Args:
          blank_id (int): token id corresopnding to blank, only support 0 for now. (Default: 0)
          vocab_list (List[str]): list of vocabulary tokens
          beam_size (int, optional): max number of hypos to hold after each decode step (Default: 10)
          nbest (int): number of best decodings to return
          blank_skip_threshold (float):
              skip frames if log_prob(blank) > log(blank_skip_threshold), to speed up decoding.
              (Default: 0.95).
          cuda_stream (torch.cuda.streams.Stream): using assigned cuda stream (Default: using default stream)
  
      """
      if cuda_stream:
          if not isinstance(cuda_stream, torch.cuda.streams.Stream):
              raise AssertionError(
                  "cuda_stream must be torch.cuda.streams.Stream"
              )
      cuda_stream_ = (
          cuda_stream.cuda_stream
          if cuda_stream
          else torch.cuda.current_stream().cuda_stream
      )
      self.internal_data = cuctc.prefixCTC_alloc(cuda_stream_)
      self.memory = torch.empty(
          0, dtype=torch.int8, device=torch.device("cuda")
      )
      if blank_id != 0:
          raise AssertionError("blank_id must be 0")
      self.blank_id = blank_id
      self.vocab_list = vocab_list
      self.space_id = 0
      self.nbest = nbest
      if not (blank_skip_threshold >= 0 and blank_skip_threshold <= 1):
          raise AssertionError(
              "blank_skip_threshold must be between 0 and 1"
          )
      self.blank_skip_threshold = math.log(blank_skip_threshold)
      self.beam_size = min(beam_size, len(vocab_list))
  
file_path: audio/src/torchaudio/models/decoder/_cuda_ctc_decoder.py
imports: from __future__ import annotations
  import math
  from typing import List, NamedTuple, Union
  import torch
  import torchaudio
  import torchaudio.lib.pybind11_prefixctc
label_desc: Use image node_id 1 to create a new CUCTCDecoder object  with example: obj = CUCTCDecoder(vocab_list, blank_id, beam_size, nbest, blank_skip_threshold, cuda_stream)