$Input$, $x$ and $y$ can carry the LoD (Level of Details) information, or not. But the output only shares the LoD information with input $input$.
$Input$, $x$ and $y$ can carry the LoD (Level of Details) information, or not. But the output only shares the LoD information with input $input$.
Args:
Args:
input (Variable): The input Tensor/LoDTensor to be added to the final result.
input (Tensor): The input Tensor to be added to the final result.
x (Variable): The first input Tensor/LoDTensor for matrix multiplication.
x (Tensor): The first input Tensor for matrix multiplication.
y (Variable): The second input Tensor/LoDTensor for matrix multiplication.
y (Tensor): The second input Tensor for matrix multiplication.
beta (float): Coefficient of $input$.
beta (float): Coefficient of $input$.
alpha (float): Coefficient of $x*y$.
alpha (float): Coefficient of $x*y$.
name (str, optional): Name of the output. Normally there is no need for user to set this property. For more information, please refer to :ref:`api_guide_Name`. Default is None.
name (str, optional): Name of the output. Normally there is no need for user to set this property. For more information, please refer to :ref:`api_guide_Name`. Default is None.
Returns:
Returns:
Variable(Tensor/LoDTensor): The output Tensor/LoDTensor of addmm op.
Tensor: The output Tensor of addmm op.
Examples:
Examples:
.. code-block:: python
.. code-block:: python
import numpy as np
import paddle
import paddle
data_x = np.ones((2, 2)).astype(np.float32)
x = paddle.ones([2,2])
data_y = np.ones((2, 2)).astype(np.float32)
y = paddle.ones([2,2])
data_input = np.ones((2, 2)).astype(np.float32)
input = paddle.ones([2,2])
paddle.disable_static()
x = paddle.to_tensor(data_x)
y = paddle.to_tensor(data_y)
input = paddle.to_tensor(data_input)
out = paddle.tensor.addmm( input=input, x=x, y=y, beta=0.5, alpha=5.0 )
out = paddle.addmm( input=input, x=x, y=y, beta=0.5, alpha=5.0 )