You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Sep 9, 2026. It is now read-only.
Repository navigation
This repository was archived by the owner on Sep 9, 2026. It is now read-only.
Traceback (most recent call last): File "/Users/jackmin/Jina/docarray/oink.py", line 16, in <module> a.copy(deep=True) File "pydantic/main.py", line 657, in pydantic.main.BaseModel.copy File "pydantic/main.py", line 612, in pydantic.main.BaseModel._copy_and_set_values File "/Users/jackmin/miniconda3/envs/docarray/lib/python3.10/copy.py", line 146, in deepcopy y = copier(x, memo) File "/Users/jackmin/miniconda3/envs/docarray/lib/python3.10/copy.py", line 231, in _deepcopy_dict y[deepcopy(key, memo)] = deepcopy(value, memo) File "/Users/jackmin/miniconda3/envs/docarray/lib/python3.10/copy.py", line 153, in deepcopy y = copier(memo) File "/Users/jackmin/miniconda3/envs/docarray/lib/python3.10/site-packages/torch/_tensor.py", line 100, in __deepcopy__ return handle_torch_function(Tensor.__deepcopy__, (self,), self, memo) File "/Users/jackmin/miniconda3/envs/docarray/lib/python3.10/site-packages/torch/overrides.py", line 1534, in handle_torch_function result = torch_func_method(public_api, types, args, kwargs) File "/Users/jackmin/Jina/docarray/docarray/typing/tensor/torch_tensor.py", line 225, in __torch_function__ return super().__torch_function__(func, types_, args, kwargs) File "/Users/jackmin/miniconda3/envs/docarray/lib/python3.10/site-packages/torch/_tensor.py", line 1279, in __torch_function__ ret = func(*args, **kwargs) File "/Users/jackmin/miniconda3/envs/docarray/lib/python3.10/site-packages/torch/_tensor.py", line 185, in __deepcopy__ raise RuntimeError(RuntimeError: The default implementation of __deepcopy__() for non-wrapper subclasses only works for subclass types that implement new_empty() and for which that function returns another instance of the same subclass. You should either properly implement new_empty() for your subclass or override __deepcopy__() if it is intended behavior for new_empty() to return an instance of a different type.
Activity
gusseppe commentedon Jul 20, 2023
Describe the bug
TorchTensor cannot be deep copied.
docarray.version
'0.36.0'
Related:
#1143
To Reproduce
script.py