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’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

02_tensor_basics.py #15

Open
gaushi opened this issue Mar 31, 2022 · 0 comments
Open

02_tensor_basics.py #15

gaushi opened this issue Mar 31, 2022 · 0 comments

Comments

@gaushi
Copy link

gaushi commented Mar 31, 2022

Hi @python-engineer ,
on line 131, shouldn't we assign z again on CPU?
z = z.to("cpu") before then calling z.numpy()
I got following error without doing so:

TypeError: can't convert cuda:0 device type tensor to numpy. Use Tensor.cpu() to copy the tensor to host memory first.

Thanks for all the great material!
Cheers,
Gautam

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant