Shortcuts

CUCTCDecoder

class torchaudio.models.decoder.CUCTCDecoder[source]

CUDA CTC beam search decoder.

This feature supports the following devices: CUDA

Note

To build the decoder, please use the factory function cuda_ctc_decoder().

Tutorials using CUCTCDecoder:
ASR Inference with CUDA CTC Decoder

ASR Inference with CUDA CTC Decoder

ASR Inference with CUDA CTC Decoder

Methods

__call__

CUCTCDecoder.__call__(log_prob: Tensor, encoder_out_lens: Tensor)[source]
Parameters:
  • log_prob (torch.FloatTensor) – GPU tensor of shape (batch, frame, num_tokens) storing sequences of probability distribution over labels; log_softmax(output of acoustic model).

  • lengths (dpython:type torch.python:int32) – GPU tensor of shape (batch, ) storing the valid length of in time axis of the output Tensor in each batch.

Returns:

List of sorted best hypotheses for each audio sequence in the batch.

Return type:

List[List[CUCTCHypothesis]]

Support Structures

CUCTCHypothesis

class torchaudio.models.decoder.CUCTCHypothesis(tokens: List[int], words: List[str], score: float)[source]

Represents hypothesis generated by CUCTC beam search decoder CUCTCDecoder.

Tutorials using CUCTCHypothesis:
ASR Inference with CUDA CTC Decoder

ASR Inference with CUDA CTC Decoder

ASR Inference with CUDA CTC Decoder
tokens: List[int]

Predicted sequence of token IDs. Shape (L, ), where L is the length of the output sequence

words: List[str]

List of predicted tokens. Algin with modeling unit.

score: float

Score corresponding to hypothesis

Docs

Access comprehensive developer documentation for PyTorch

View Docs

Tutorials

Get in-depth tutorials for beginners and advanced developers

View Tutorials

Resources

Find development resources and get your questions answered

View Resources