未验证 提交 c2cb8f00 编写于 作者: L Li Fuchen 提交者: GitHub

fix docstr of ctc_loss and CTCLoss, test=document_fix (#26584)

上级 656e60b1
...@@ -1007,10 +1007,10 @@ def ctc_loss(log_probs, ...@@ -1007,10 +1007,10 @@ def ctc_loss(log_probs,
label_lengths = np.array([3, 3]).astype("int64") label_lengths = np.array([3, 3]).astype("int64")
paddle.disable_static() paddle.disable_static()
log_probs = paddle.to_variable(log_probs) log_probs = paddle.to_tensor(log_probs)
labels = paddle.to_variable(labels) labels = paddle.to_tensor(labels)
input_lengths = paddle.to_variable(input_lengths) input_lengths = paddle.to_tensor(input_lengths)
label_lengths = paddle.to_variable(label_lengths) label_lengths = paddle.to_tensor(label_lengths)
loss = F.ctc_loss(log_probs, labels, loss = F.ctc_loss(log_probs, labels,
input_lengths, input_lengths,
......
...@@ -840,10 +840,10 @@ class CTCLoss(fluid.dygraph.Layer): ...@@ -840,10 +840,10 @@ class CTCLoss(fluid.dygraph.Layer):
label_lengths = np.array([3, 3]).astype("int64") label_lengths = np.array([3, 3]).astype("int64")
paddle.disable_static() paddle.disable_static()
log_probs = paddle.to_variable(log_probs) log_probs = paddle.to_tensor(log_probs)
labels = paddle.to_variable(labels) labels = paddle.to_tensor(labels)
input_lengths = paddle.to_variable(input_lengths) input_lengths = paddle.to_tensor(input_lengths)
label_lengths = paddle.to_variable(label_lengths) label_lengths = paddle.to_tensor(label_lengths)
loss = paddle.nn.CTCLoss(blank=0, reduction='none')(log_probs, labels, loss = paddle.nn.CTCLoss(blank=0, reduction='none')(log_probs, labels,
input_lengths, input_lengths,
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册