torch.foreach.clone#
- torch.foreach.clone(inputs: TensorList, /, *, memory_format: memory_format | None = None) tuple[Tensor, ...][source]#
Clones every tensor in
inputs.This is semantically equivalent to applying
torch.clone()independently at every list position. Does not mutate its arguments and returns a tuple of result tensors.Tensor-list arguments must be non-empty. An accelerated multi-tensor implementation is used only when supported by the inputs; otherwise the operation falls back to per-tensor execution.
- Parameters:
memory_format (
torch.memory_format, optional) – desired memory format. IfNone, the input memory format is preserved. Default:None.
- Returns:
a tuple containing the cloned tensors.