Add metacompile of Ternary if (#51789)
Summary:
Fixes issue: https://github.com/pytorch/pytorch/issues/49728
========
Ternary if operation fails in Torchscript when the condition variable is annotated as Final.
Tests:
=======
pytest -k test_ternary_static_if test/test_jit.py
Pull Request resolved: https://github.com/pytorch/pytorch/pull/51789
Reviewed By: gmagogsfm
Differential Revision: D26278969
Pulled By: nikithamalgifb
fbshipit-source-id: 27d1383290211503188428fb2e8b7749f59ba16e