Solved by Siladittya_Manna in post #2 
              
              
                Adding model.to("cpu") before the for loop worked. 
Thanks!! 
(Also need to move the model back to the device before passing an input through the model)