Could you define what you mean by in loop? Is it a training or testing loop?
Assuming you want to benchmark your GPU you can use the this repo
  
      
      github.com
  
  
    

ryujaehun/pytorch-gpu-benchmark 15


  Using the famous cnn model in Pytorch, we run benchmarks on various gpu.