未验证 提交 7a66160d 编写于 作者: W wawltor 提交者: GitHub

[cherrypick] change paddle.mm api to matmul v2 op (#36374)

* change the paddle.mm to matmul_v2

* update the code for the mm

* update the document for the mm
上级 ce6a27d9
......@@ -923,8 +923,6 @@ def mm(input, mat2, name=None):
nontransposed, the prepended or appended dimension :math:`1` will be
removed after matrix multiplication.
This op does not support broadcasting. See paddle.matmul.
Args:
input (Tensor): The input tensor which is a Tensor.
mat2 (Tensor): The input tensor which is a Tensor.
......@@ -949,9 +947,7 @@ def mm(input, mat2, name=None):
"""
if in_dygraph_mode():
out = _varbase_creator(dtype=input.dtype)
_C_ops.matmul(input, mat2, out)
return out
return _C_ops.matmul_v2(input, mat2)
def __check_input(x, y):
var_names = {'x': x, 'y': y}
......@@ -991,7 +987,7 @@ def mm(input, mat2, name=None):
helper = LayerHelper('mm', **locals())
out = helper.create_variable_for_type_inference(dtype=input.dtype)
helper.append_op(
type='matmul', inputs={'X': input,
type='matmul_v2', inputs={'X': input,
'Y': mat2}, outputs={'Out': out})
return out
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册