fix check issue for replace_params_with_constants (#105909)
fix check issue for replace_params_with_constants to make llama mode const folding work.
Pull Request resolved: https://github.com/pytorch/pytorch/pull/105909
Approved by: https://github.com/jgong5, https://github.com/eellison