Add ModuleInfo-based device transfer tests (#68092)
Summary:
Continuation of https://github.com/pytorch/pytorch/issues/65488; addresses the problem that got it reverted.
Pull Request resolved: https://github.com/pytorch/pytorch/pull/68092
Reviewed By: mruberry
Differential Revision: D32299103
Pulled By: jbschlosser
fbshipit-source-id: bc298aca15368f2acb5082e6fb6eedea60b5d75f