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?

1 Answer 1

1

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

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.