Fix DataParallel(cpu_m).cuda() not working by checking at forward (#17363)
Summary:
Fixes #17362
Pull Request resolved: https://github.com/pytorch/pytorch/pull/17363
Differential Revision: D14175151
Pulled By: soumith
fbshipit-source-id: 7b7e2335d553ed2133287deeaca3f6b6254aea4a