The assert referenced below will always assert for Constants that contain a NaN since such constants will always return false from isEqual. Furthermore, Constants that contain NaN will not be de-duplicated for this same reason. Perhaps it would be better to avoid using isEqual in ConstsEqDedup and instead do a bit-wise comparison.
This assert fires intermittently in the test GraphOptz.ReshapeConstantOneUse depending on whether the uninitialized input tensor contains a NaN.
Thanks for reporting this issue @geoffberry! Are you interested in putting up a fix for this?
Nice catch! I kind of think that assert is problematic; iirc a vanilla std::map<float> will fail to find NAN keys too. Idk if it鈥檚 worth adding special logic to dedup constants with NAN but I鈥檓 kind of ok either way.
I'm going to start working on a patch shortly.
Thanks @chadrosier!
Most helpful comment
I'm going to start working on a patch shortly.