[PyTorch] Don't create intermediate Tensor for at::result_type w/Scalar (#55232)
Summary:
Pull Request resolved: https://github.com/pytorch/pytorch/pull/55232
Fixes https://github.com/pytorch/pytorch/issues/55229 .
ghstack-source-id: 125616311
Test Plan: Looks like test/test_type_promotion.py covers this.
Reviewed By: ezyang
Differential Revision: D27536521
fbshipit-source-id: 3e686934f845588da07de9190c9760c8ed453caf