A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://docs.pytorch.org/docs/stable/generated/torch.addcmul.html below:

torch.addcmul — PyTorch 2.7 documentation

torch.addcmul
torch.addcmul(input, tensor1, tensor2, *, value=1, out=None) Tensor

Performs the element-wise multiplication of tensor1 by tensor2, multiplies the result by the scalar value and adds it to input.

out i = input i + value × tensor1 i × tensor2 i \text{out}_i = \text{input}_i + \text{value} \times \text{tensor1}_i \times \text{tensor2}_i outi=inputi+value×tensor1i×tensor2i

The shapes of tensor, tensor1, and tensor2 must be broadcastable.

For inputs of type FloatTensor or DoubleTensor, value must be a real number, otherwise an integer.

Parameters
  • input (Tensor) – the tensor to be added

  • tensor1 (Tensor) – the tensor to be multiplied

  • tensor2 (Tensor) – the tensor to be multiplied

Keyword Arguments
  • value (Number, optional) – multiplier for t e n s o r 1. ∗ t e n s o r 2 tensor1 .* tensor2 tensor1.tensor2

  • out (Tensor, optional) – the output tensor.

Example:

>>> t = torch.randn(1, 3)
>>> t1 = torch.randn(3, 1)
>>> t2 = torch.randn(1, 3)
>>> torch.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]])
Docs

Access comprehensive developer documentation for PyTorch

View Docs Tutorials

Get in-depth tutorials for beginners and advanced developers

View Tutorials Resources

Find development resources and get your questions answered

View Resources

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4