[JIT] Add gradient check in constants (#64613)
Summary:
fixes internal issue
Pull Request resolved: https://github.com/pytorch/pytorch/pull/64613
Reviewed By: Gamrix
Differential Revision: D30799016
Pulled By: eellison
fbshipit-source-id: 48ef52d1cac627919e6cd232216d24878a2a8b58