未验证 提交 3bbf2d7e 编写于 作者: W wanghuancoder 提交者: GitHub

linear use matmul bug not matmul_v2 (#33286)

上级 b432d024
...@@ -1446,7 +1446,9 @@ def linear(x, weight, bias=None, name=None): ...@@ -1446,7 +1446,9 @@ def linear(x, weight, bias=None, name=None):
# [2.1077576 2.1077576 2.1077576 2.1077576 ]] # [2.1077576 2.1077576 2.1077576 2.1077576 ]]
""" """
if in_dygraph_mode(): if in_dygraph_mode():
pre_bias = core.ops.matmul_v2(x, weight) pre_bias = _varbase_creator(dtype=x.dtype)
core.ops.matmul(x, weight, pre_bias, 'transpose_X', False,
'transpose_Y', False, "alpha", 1)
if bias is None: if bias is None:
return pre_bias return pre_bias
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册