Skip to content

Commit 1fe0221

Browse files
authored
[Docs] Add Explaination of zero_infinity into CTCLoss() (#76188)
1 parent ab153e6 commit 1fe0221

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

python/paddle/nn/layer/loss.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1292,6 +1292,7 @@ class CTCLoss(Layer):
12921292
- input_lengths (Tensor): The length for each input sequence, it should have shape [batch_size] and dtype int64.
12931293
- label_lengths (Tensor): The length for each label sequence, it should have shape [batch_size] and dtype int64.
12941294
- 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.
1295+
- zero_infinity (bool, optional): If True, set infinite loss to zero. Default: False.
12951296
12961297
Returns:
12971298
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``.

0 commit comments

Comments
 (0)