Reputation: 5
I am very new to Pytorch. While finding the value of a variable, this is how it shows
tensor(0.94091, device='cuda:0')
How to access the number, i.e, 0.94091?
Upvotes: 0
Views: 158
Reputation: 309
you can use .item() to get the value of size one tensor.
Upvotes: 1