Rate this Page

torch.foreach.addcdiv#

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

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

This is semantically equivalent to applying torch.addcdiv() independently at every list position. Does not mutate its arguments and returns a tuple of result tensors.

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:

a tuple containing one result tensor for each input tensor.