Skip to content

Make StorageImpl untyped for non-POD types #33950

@ezyang

Description

@ezyang

Right now StorageImpl records a dtype. We should remove the dtype and store bytes directly. Non-POD dtypes should still support custom destruction, but that is built on top of an otherwise untyped representation. Representing storage impls in an untyped way means that we can reinterpret cast tensors, e.g., view a float tensor as a complex tensor.

In the user side we still expose ByteStorage/LongStorage; these should either be eliminated from Python, or implemented as wrappers that know dtype.

cc @ezyang @gchanan @zou3519 @anjali411 @dylanbespalko

Metadata

Metadata

Assignees

Labels

high priorityinternalsmodule: complexRelated to complex number support in PyTorchmodule: internalsRelated to internal abstractions in c10 and ATentriagedThis 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