torch.foreach.copy_#
- torch.foreach.copy_(inputs: TensorList, src: TensorList, /, *, non_blocking: bool = False) tuple[Tensor, ...] | list[Tensor][source]#
Copies each tensor in
srcinto the corresponding tensor ininputs, followingtorch.Tensor.copy_().This is semantically equivalent to applying
torch.Tensor.copy_()independently at every list position. Mutates every tensor ininputsand 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.
There is no functional
torch.foreach.copyoperation.