[PyTorch] Fix extra refcount bumps in tryEvalTypeVariables (#66722)
Summary:
Pull Request resolved: https://github.com/pytorch/pytorch/pull/66722
Missing move, s/cast/castRaw/, and take TypePtr arg by const ref because we only sometimes need to take ownership.
ghstack-source-id: 140757141
Test Plan: CI
Reviewed By: suo
Differential Revision: D31697631
fbshipit-source-id: 04afe13688c6e2aaf79157400c0a44021cb8179d