0

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?

Learner
  • 5
  • 2

1 Answers1

1

you can use .item() to get the value of size one tensor.

Milad Yousefi
  • 191
  • 2
  • 9