mirror of
https://github.com/pytorch/pytorch.git
synced 2025-10-21 13:44:15 +08:00
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:
committed by
PyTorch MergeBot
parent
e213c6addf
commit
268bbecf1c
@ -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()
|
||||
|
Reference in New Issue
Block a user