Add option for allowing non-fake inputs, add deepcopy impl

Pull Request resolved: https://github.com/pytorch/pytorch/pull/79580

Approved by: https://github.com/samdow
This commit is contained in:
Elias Ellison
2022-06-17 08:51:42 -07:00
committed by PyTorch MergeBot
parent e213c6addf
commit 268bbecf1c
8 changed files with 102 additions and 56 deletions

View File

@ -96,6 +96,7 @@ class Tensor(torch._C._TensorBase):
# doesn't work because of
# https://github.com/pytorch/pytorch/issues/47442
# Update the test in test_serialization if you remove 'meta' from here
if self.is_sparse or self.device.type in ['lazy', 'xla', 'mps', 'ort', 'meta', 'hpu'] or \
(type(self) is not Tensor and self.data_ptr() == 0):
new_tensor = self.clone()