mirror of
https://github.com/pytorch/pytorch.git
synced 2025-10-21 13:44:15 +08:00
updated torch clone docs to reflect implemented memory behavior Fixes #156644 Pull Request resolved: https://github.com/pytorch/pytorch/pull/157007 Approved by: https://github.com/malfet, https://github.com/svekars Co-authored-by: Svetlana Karslioglu <svekars@meta.com>
This commit is contained in:
committed by
PyTorch MergeBot
parent
3ee75b7eac
commit
130d4973bd
@ -2782,6 +2782,12 @@ Returns a copy of :attr:`input`.
|
||||
result of this operation to :attr:`input`. To create a tensor without an
|
||||
autograd relationship to :attr:`input` see :meth:`~Tensor.detach`.
|
||||
|
||||
In addition, when ``torch.preserve_format`` is used:
|
||||
If the input tensor is dense (i.e., non-overlapping strided),
|
||||
its memory format (including strides) is retained.
|
||||
Otherwise (e.g., a non-dense view like a stepped slice),
|
||||
the output is converted to the dense (contiguous) format.
|
||||
|
||||
Args:
|
||||
{input}
|
||||
|
||||
|
Reference in New Issue
Block a user