Use polyfill to implement comparison operators (#144485)
Summary:
X-link: https://github.com/pytorch/pytorch/pull/144485
Approved by: https://github.com/jansel
Reviewed By: atalman
Differential Revision: D69256620
fbshipit-source-id: 51719153d0488f44e4fd3555d43f661161173f76