mindspore/docs/api/api_python/ops/mindspore.ops.RNNTLoss.rst

25 lines
1.1 KiB
ReStructuredText
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

mindspore.ops.RNNTLoss
=======================
.. py:class:: mindspore.ops.RNNTLoss(blank_label=0)
计算相对于softmax输出的RNNTLoss及其梯度。
参数:
- **blank_label** (int) - 空白标签。默认值0。
输入:
- **acts** (Tensor) - Tensorshape为 :math:`(B,T,U,V)` 。数据类型必须为float16或float32。
- **labels** (Tensor) - Tensorshape为 :math:`(B, U-1)` 。数据类型为int32。
- **input_lengths** (Tensor) - Tensorshape为 :math:`(B,)` 。数据类型为int32。
- **label_lengths** (Tensor) - Tensorshape为 :math:`(B,)` 。数据类型为int32。
输出:
- **costs** (Tensor) - Tensorshape为 :math:`(B,)` 。数据类型为int32。
- **grads** (Tensor) - 具有与 `acts` 相同的shape和dtype。
异常:
- **TypeError** - 如果 `acts``labels``input_lengths``label_lengths` 不是Tensor。
- **TypeError** - 如果 `acts` 的dtype既不是float16也不是float32。
- **TypeError** - 如果 `labels``input_lengths``label_lengths` 的dtype不是int32。