KEMBAR78
NestedTensor cannot be pickled · Issue #104198 · pytorch/pytorch · GitHub
Skip to content

NestedTensor cannot be pickled #104198

@vkovac2

Description

@vkovac2
import torch
import pickle

a, b = torch.arange(3), torch.arange(5) + 3
nt = torch.nested.nested_tensor([a, b])
with open('tensor.pkl', 'wb') as f:
    pickle.dump(nt, f)
click to see original report

🚀 The feature, motivation and pitch

Hello,

I am trying to make a custom dataset class of ZINC dataset on PyTorch geometric with nested tensors using "torch.nested.nested_tensor", and when executing I got the following error:

"Internal error: NestedTensorImpl doesn't support sizes."

Is there a way to get the of the different tensors in the nested tensor?

Thanks

Alternatives

No response

Additional context

No response

cc @mruberry @mikaylagawarecki @cpuhrsch @jbschlosser @bhosmer @drisspg

Metadata

Metadata

Assignees

No one assigned

    Labels

    actionablemodule: nestedtensorNestedTensor tag see issue #25032module: pickleProblems related to pickling of PyTorch objectsmodule: serializationIssues related to serialization (e.g., via pickle, or otherwise) of PyTorch objectstriagedThis issue has been looked at a team member, and triaged and prioritized into an appropriate module

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions