I found a similar issue in 1.4.0, and upgrading to 1.8.1 fixes it. The release notes for 1.8.0 reference PR #46441 which

adds hashing for many other types including Tuple , bool , device by implementing generic hashing on IValue

I believe this is the improvement that resolved the root issue