On this page
torch.Tensor.set_
Tensor.set_(source=None, storage_offset=0, size=None, stride=None) → Tensor-
Sets the underlying storage, size, and strides. If
sourceis a tensor,selftensor will share the same storage and have the same size and strides assource. Changes to elements in one tensor will be reflected in the other.If
sourceis aStorage, the method sets the underlying storage, offset, size, and stride.
© 2024, PyTorch Contributors
PyTorch has a BSD-style license, as found in the LICENSE file.
https://pytorch.org/docs/2.1/generated/torch.Tensor.set_.html