Skip to content
This repository was archived by the owner on Sep 9, 2026. It is now read-only.
This repository was archived by the owner on Sep 9, 2026. It is now read-only.

TorchTensor cannot be deep copied. #1719

Description

@gusseppe

Describe the bug
TorchTensor cannot be deep copied.

docarray.version
'0.36.0'

Related:
#1143

To Reproduce
script.py

import torch
from docarray import BaseDoc
from docarray.typing import TorchTensor
class Meow(BaseDoc):
    embedding : TorchTensor

a = Meow(embedding=torch.randn(42))
print(id(a.embedding), id(a.copy(deep=True).embedding))

Originally posted by @gusseppe in #1131 (comment)

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions