replace type().backend() with device() (#52558)
Summary: Pull Request resolved: https://github.com/pytorch/pytorch/pull/52558
Reviewed By: malfet
Differential Revision: D26616025
Pulled By: jbschlosser
fbshipit-source-id: ef9f3f42e830788c21feab533e192ba9c6eb8edb