From b1722789f44619f9bccdead9bdbdb5bd38ac4c90 Mon Sep 17 00:00:00 2001 From: ice Date: Mon, 3 Nov 2025 18:57:54 +0800 Subject: [PATCH] Update loss.py --- python/paddle/nn/layer/loss.py | 1 + 1 file changed, 1 insertion(+) diff --git a/python/paddle/nn/layer/loss.py b/python/paddle/nn/layer/loss.py index 8ede3440ae1ef5..6dfd78ba0b5258 100644 --- a/python/paddle/nn/layer/loss.py +++ b/python/paddle/nn/layer/loss.py @@ -1292,6 +1292,7 @@ class CTCLoss(Layer): - input_lengths (Tensor): The length for each input sequence, it should have shape [batch_size] and dtype int64. - label_lengths (Tensor): The length for each label sequence, it should have shape [batch_size] and dtype int64. - norm_by_times (bool, optional): Whether to normalize the gradients by the number of time-step, which is also the sequence's length. There is no need to normalize the gradients if reduction mode is 'mean'. Default: False. + - zero_infinity (bool, optional): If True, set infinite loss to zero. Default: False. Returns: Tensor, The Connectionist Temporal Classification (CTC) loss between ``log_probs`` and ``labels``. If attr:`reduction` is ``'none'``, the shape of loss is [batch_size], otherwise, the shape of loss is []. Data type is the same as ``log_probs``.