Skip to content

Commit

Permalink
linear use matmul bug not matmul_v2 (#33286)
Browse files Browse the repository at this point in the history
  • Loading branch information
wanghuancoder authored Jun 3, 2021
1 parent b432d02 commit 3bbf2d7
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion python/paddle/nn/functional/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -1446,7 +1446,9 @@ def linear(x, weight, bias=None, name=None):
# [2.1077576 2.1077576 2.1077576 2.1077576 ]]
"""
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:
return pre_bias
Expand Down

0 comments on commit 3bbf2d7

Please sign in to comment.