Make device_of take tensor by const ref
Summary: Pull Request resolved: https://github.com/pytorch/pytorch/pull/22556
Test Plan: Imported from OSS
Differential Revision: D16137540
Pulled By: jamesr66a
fbshipit-source-id: 8a6be6edd602c53edc954508ea27d8a6071bd964