check devices for all input tensors in index_put (#31280)
Summary:
Fix for https://github.com/pytorch/pytorch/issues/30960
Pull Request resolved: https://github.com/pytorch/pytorch/pull/31280
Differential Revision: D19149114
Pulled By: ngimel
fbshipit-source-id: af185a98ac6ea614f43bbf865de02ea113d4ed56