Use dispatch tensor for device_guard instead of first Tensor argument
Summary: Pull Request resolved: https://github.com/pytorch/pytorch/pull/16579
Differential Revision: D13886593
Pulled By: cpuhrsch
fbshipit-source-id: 0722ec61da13c2541f7de51bf5c1ecfb9a12fad2