autograd: move scalar input to a different device when needed (#35286)
Summary:
Fixes https://github.com/pytorch/pytorch/issues/33870
Pull Request resolved: https://github.com/pytorch/pytorch/pull/35286
Differential Revision: D21229721
Pulled By: albanD
fbshipit-source-id: 6f6a6d44b675457c9580ec2d91da52d12d44f096