guan404ming commented on PR #379: URL: https://github.com/apache/tvm-ffi/pull/379#issuecomment-3706699123
> I'm not totally sure about using structural equality/hash for array/map comparison - It's a recursively defined equality based on IR structure, which is rather compute intensive. Does Python define it's tuple/dict equality recursively? Thanks for the question! Based on my review of CPython's implementation, Python does use recursive equality for tuple/dict. For example, tuple_richcompare (tupleobject.c:689) calls PyObject_RichCompareBool recursively on each element. Dict equality follows the same pattern. So I think `StructuralEqual` matches Python's semantics here. Reference - Tuple equality: https://github.com/python/cpython/blob/main/Objects/tupleobject.c - Uses PyObject_RichCompareBool() to recursively compare each element - Dict equality: https://github.com/python/cpython/blob/main/Objects/dictobject.c - Similar recursive element-by-element comparison -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
