CUCTCDecoder
- class torchaudio.models.decoder.CUCTCDecoder[source]
CUDA CTC beam search decoder.
Note
To build the decoder, please use the factory function
cuda_ctc_decoder()
.- Tutorials using
CUCTCDecoder
:
- Tutorials using
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
:
- tokens: List[int]
Predicted sequence of token IDs. Shape (L, ), where L is the length of the output sequence
- score: float
Score corresponding to hypothesis
- Tutorials using