8000 torch.Size is not pickleable in Python 2 · Issue #20823 · pytorch/pytorch · GitHub
[go: up one dir, main page]

Skip to content
torch.Size is not pickleable in Python 2 #20823
@colesbury

Description

@colesbury

🐛 Bug

torch.Size objects (returned by Tensor.shape) are not pickleable in Python 2.7. They can be pickled in Python 3.

To Reproduce

import torch
import pickle

pickle.dumps(torch.randn(10).shape)  # TypeError: can't pickle Size objects

Environment

PyTorch 1.0.1.post2 (but I believe it also is present in master as of 5/22/19)
Python 2.7.15 on Mac OS X

Metadata

Metadata

Assignees

Labels

module: 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

    0