[ONNX] Support device().type() string comparison with constant (#86168)
Fixes #86168
Pull Request resolved: https://github.com/pytorch/pytorch/pull/86168
Approved by: https://github.com/justinchuby, https://github.com/AllenTiTaiWang, https://github.com/abock