Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

The get_device method is defined in the storage related class, but it does not seem to be implemented. #99817

Closed
fakeYan opened this issue Apr 23, 2023 · 0 comments
Labels
triaged This issue has been looked at a team member, and triaged and prioritized into an appropriate module

Comments

@fakeYan
Copy link
Contributor

fakeYan commented Apr 23, 2023

馃悰 Describe the bug

import torch

x = torch.rand(2,3)

print(x.storage().get_device())

x = x.cuda()
print(x.storage().get_device())

Versions

I don鈥檛 have to watch every version.
torch\storage.py
image

In v2.1.0 main branch I can't find the code
torch\csrc\StorageMethods.cpp

image
call get_device() return None
image

In v1.11.0 torch\csrc\generic\StorageMethods.cpp锛宧as method锛宎nd get value.
image

@fakeYan fakeYan changed the title tThe get_device method is defined in the storage related class, but it does not seem to be implemented. The get_device method is defined in the storage related class, but it does not seem to be implemented. Apr 23, 2023
@mikaylagawarecki mikaylagawarecki added the triaged This issue has been looked at a team member, and triaged and prioritized into an appropriate module label Apr 25, 2023
pytorchmergebot pushed a commit that referenced this issue Apr 25, 2023
Fixes #ISSUE_NUMBER
like #99817, I find a method is missing,
I'm not sure if it was intentionally removed. But I found that the function is still called on the python side, and the function seems to be very simple to implement.
So I made a change in python side.

Pull Request resolved: #99818
Approved by: https://github.com/ezyang
@fakeYan fakeYan closed this as completed Apr 25, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
triaged This issue has been looked at a team member, and triaged and prioritized into an appropriate module
Projects
None yet
Development

No branches or pull requests

2 participants