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. must be a subclass of .
Makes a cls instance with the same data pointer as self. Changes
in the output mirror changes in self, and the output stays attached
to the autograd graph. must be a subclass of .
clsTensor