Skip to content

Wrapper-based torch_dispatch objects report maybe incorrect device #62730

@zou3519

Description

@zou3519

This is possibly intentional?

Using LoggingTensor,

x = LoggingTensor(torch.empty([]))
print(x.device)
# prints "meta"

The extension writer can add a .device attribute to their class (LoggingTensor) to solve the problem in Python-land but it doesn't solve the problem in C++ land. In C++ land x.options() will return a meta device and there is code like toType that will use the device to do things.

cc @ezyang @bdhirsh

Metadata

Metadata

Assignees

No one assigned

    Labels

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