You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
__eq__ operator overloading should be prepared to accept any type #2050
Some of the __eq__ operators in cuda_core assuming that the rhs side will be the same type as the lhs. This will result in raising an AttributeError (or worse) rather than returning False.
We need to do something like this (across the whole codebase):
- def __eq__(self : _StridedLayout, other : _StridedLayout) -> bool:- return self.itemsize == other.itemsize and self.slice_offset == other.slice_offset and _base_layout_equal(self.base, other.base)+ def __eq__(self, other) -> bool:+ if not isinstance(other, _StridedLayout):+ return NotImplemented+ cdef _StridedLayout _other = <_StridedLayout>other+ return self.itemsize == _other.itemsize and self.slice_offset == _other.slice_offset and _base_layout_equal(self.base, _other.base)
Activity
Fix NVIDIA#2050: Fix __eq__ implementations (NVIDIA#2067)