[EZ][BE] Fix the massively annoying strict-weak-ordering issue. (#105189)
Summary:
kip_fist_pump
Running any EgoOCR workflow in non-opt modes was breaking with https://fburl.com/strict-weak-ordering
Painstakingly found out that the stable_sort comparator in the generate_proposals caffe2 op was the issue due to numerical imprecision. This was causing Word Detector model to barf with the error. Adding explicit handling for the [irreflexivity property](https://www.boost.org/sgi/stl/StrictWeakOrdering.html) fixes this annoying strict-weak-ordering issue that has bugged me and several others(https://fb.workplace.com/groups/1405155842844877/permalink/7079705785389826/) for a while.
We can finally run all OCR workflows in non-opt mode! :)
Test Plan:
Debugged this with `fdb --disable-auto-breakpoints --secondary-debugger=lldb buck2 run mode/dev-sand ai_demos/server_model_zoo/models/ego_ocr_e2e_prod:ego_ocr_e2e_prod_binary`
and running `breakpoint set -E c++` in the lldb terminal.
Differential Revision: D47446816
Pull Request resolved: https://github.com/pytorch/pytorch/pull/105189
Approved by: https://github.com/malfet, https://github.com/atalman