On this page
torch.Tensor.as_subclass
Tensor.as_subclass(cls) → Tensor-
Makes a
clsinstance with the same data pointer asself. Changes in the output mirror changes inself, and the output stays attached to the autograd graph.clsmust be a subclass ofTensor.
© 2024, PyTorch Contributors
PyTorch has a BSD-style license, as found in the LICENSE file.
https://pytorch.org/docs/2.1/generated/torch.Tensor.as_subclass.html