latest (dev)
Copy
Latest development documentation · Updated 2026-10-15
tensorplay.functional.addcmul
- tensorplay.functional.addcmul(input, tensor1, tensor2, *, value=1, out=None) Tensor[source]
Performs the element-wise multiplication of
tensor1bytensor2, multiplies the result by the scalarvalueand adds it toinput.The shapes of
tensor,tensor1, andtensor2must be broadcastable.For inputs of type FloatTensor or DoubleTensor,
valuemust be a real number, otherwise an integer.- Parameters:
- Keyword Arguments:
value (Number, optional) – multiplier for
out (Tensor, optional) – the output tensor.
Example:
>>> t = tensorplay.randn(1, 3) >>> t1 = tensorplay.randn(3, 1) >>> t2 = tensorplay.randn(1, 3) >>> tensorplay.addcmul(t, t1, t2, value=0.1) tensor([[-0.8635, -0.6391, 1.6174], [-0.7617, -0.5879, 1.7388], [-0.8353, -0.6249, 1.6511]])
Help improve this page
Found an error, an unclear step, or a missing example?
Was this page helpful?

