From 3bbf2d7e66df9c28965dcdf7f073d36462e82183 Mon Sep 17 00:00:00 2001 From: wanghuancoder Date: Thu, 3 Jun 2021 10:31:52 +0800 Subject: [PATCH] linear use matmul bug not matmul_v2 (#33286) --- python/paddle/nn/functional/common.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/python/paddle/nn/functional/common.py b/python/paddle/nn/functional/common.py index e7e36ca7a3a..57ce6c78e95 100644 --- a/python/paddle/nn/functional/common.py +++ b/python/paddle/nn/functional/common.py @@ -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 -- GitLab