Rate this Page

torch.foreach.addcmul_#

torch.foreach.addcmul_(inputs: TensorList, tensor1: TensorList, tensor2: TensorList, /, *, value: ScalarList) tuple[Tensor, ...] | list[Tensor][source]#
torch.foreach.addcmul_(inputs: TensorList, tensor1: TensorList, tensor2: TensorList, /, *, value: Tensor) tuple[Tensor, ...] | list[Tensor]
torch.foreach.addcmul_(inputs: TensorList, tensor1: TensorList, tensor2: TensorList, /, *, value: Scalar = 1) tuple[Tensor, ...] | list[Tensor]

Applies torch.addcmul() to corresponding tensors from the three input lists.

This is semantically equivalent to applying torch.addcmul() independently at every list position. Mutates every tensor in inputs and returns the exact input container object.

Tensor-list arguments must be non-empty. Corresponding tensor or scalar lists must have the same length. An accelerated multi-tensor implementation is used only when supported by the inputs; otherwise the operation falls back to per-tensor execution.

value may be one shared scalar, a scalar list or tuple, or a packed 1-D CPU tensor containing one scalar per list position.

Parameters:
  • inputs (list or tuple of Tensor) – tensors to transform.

  • tensor1 (list or tuple of Tensor) – first multiplicative or divisive operands.

  • tensor2 (list or tuple of Tensor) – second multiplicative or divisive operands.

  • value (Number, list or tuple of Number, or Tensor, optional) – scale values. Default: 1.

Returns:

the exact input list or tuple.