How to check if pytorch is using the GPU?

How do I check if pytorch is using the GPU? It’s possible to detect with nvidia-smi if there is any activity from the GPU during the process, but I want something written in a python script.

14 Answers
14

Leave a Comment