Solved by rasbt in post #2 
              
              
                I think that might be because the summary function of torchsummary has a device parameter. Try 
summary(model, (1, 784), device="cpu")

Also, for questions about external packages, it would be better to ask on the external package’s issue tracker or discussion platform.