Add support to compare devices (#53045)
Summary: Pull Request resolved: https://github.com/pytorch/pytorch/pull/53045
Test Plan:
=====
python test/test_jit.py -k test_device_not_equal
Reviewed By: pbelevich
Differential Revision: D26737964
Pulled By: nikithamalgifb
fbshipit-source-id: 2205aa1f214a86282602168c364dca1363d2f7dd