未验证 提交 933868cd 编写于 作者: L limingshu 提交者: GitHub

first commit (#45254)

上级 21a242c2
......@@ -1396,5 +1396,7 @@ class Transformer(Layer):
# [ 0. 0. 0. 0. 0.]]
"""
return paddle.tensor.triu((paddle.ones(
(length, length), dtype=paddle.get_default_dtype()) * -np.inf), 1)
return paddle.tensor.triu(
paddle.full(shape=[length, length],
fill_value=-np.inf,
dtype=paddle.get_default_dtype()), 1)
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册