Thank you very much
I need to add  that the normal == should work out of the box, and my case was a special occurance where this wasnt wroking under the debug build while it was working under the release for some unknown reasons. I spent a lot of time investigating this to no luck! I ultimately concluded as not a torch issue but maybe a VS2019 /VC++/weird project configuration issue.