latest (dev)
Copy
Latest development documentation · Updated 2026-10-15
tensorplay.nn.functional.ctc_loss
- tensorplay.nn.functional.ctc_loss(log_probs: Tensor, targets: Tensor, input_lengths, target_lengths, blank: int = 0, reduction: str = 'mean', zero_infinity: bool = False) Tensor[source]
Compute the Connectionist Temporal Classification loss.
(alpha recurrence over the blank-extended target sequence); autograd flows through
log_probsvia the composed primitives.- Parameters:
log_probs – or log-softmax outputs.
targets – or concatenated .
target_lengths (input_lengths /) – or scalars.
blank – index of the blank label. Default: 0.
reduction –
'none' | 'mean' | 'sum'.zero_infinity – zero out infinite losses (targets too long for T).
Help improve this page
Found an error, an unclear step, or a missing example?
Was this page helpful?

