Adding custom device type change rules (#69051)
Summary: Pull Request resolved: https://github.com/pytorch/pytorch/pull/69051
Test Plan: Imported from OSS
Reviewed By: anjali411
Differential Revision: D33555884
Pulled By: Gamrix
fbshipit-source-id: c38812277d0e2aa008903a4328cb72e34bc6e1e6