You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: python/paddle/tensor/linalg.py
+4-1Lines changed: 4 additions & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -266,6 +266,8 @@ def matmul(
266
266
transpose_x: bool=False,
267
267
transpose_y: bool=False,
268
268
name: str|None=None,
269
+
*,
270
+
out: Tensor|None=None,
269
271
) ->Tensor:
270
272
"""
271
273
Applies matrix multiplication to two tensors. `matmul` follows
@@ -313,6 +315,7 @@ def matmul(
313
315
transpose_x (bool, optional): Whether to transpose :math:`x` before multiplication. Default is False.
314
316
transpose_y (bool, optional): Whether to transpose :math:`y` before multiplication. Default is False.
315
317
name (str|None, optional): If set None, the layer will be named automatically. For more information, please refer to :ref:`api_guide_Name`. Default is None.
318
+
out (Tensor, optional): The output tensor. If set, the result will be stored in this tensor. Default is None.
316
319
317
320
Returns:
318
321
Tensor: The output Tensor.
@@ -360,7 +363,7 @@ def matmul(
360
363
361
364
"""
362
365
ifin_dynamic_or_pir_mode():
363
-
return_C_ops.matmul(x, y, transpose_x, transpose_y)
366
+
return_C_ops.matmul(x, y, transpose_x, transpose_y, out=out)
0 commit comments