Make getting the dtype of a tensor work for backend extensions.
Summary: Pull Request resolved: https://github.com/pytorch/pytorch/pull/17131
Differential Revision: D14093163
Pulled By: gchanan
fbshipit-source-id: 06638706e26505e3c741b7ae290000ca258599db