How to access the Tensor value?
Question:
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?
Answers:
you can use .item() to get the value of size one tensor.
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?
you can use .item() to get the value of size one tensor.