Skip to content

Commit ed9f5bc

Browse files
Add note for neq
Co-authored-by: Ricardo Vieira <[email protected]>
1 parent 74c64c6 commit ed9f5bc

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

pytensor/tensor/math.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -708,7 +708,13 @@ def eq(a, b):
708708

709709

710710
def neq(a, b):
711-
"""Elementwise inequality comparison, `a != b`."""
711+
"""Elementwise inequality comparison, `a != b`.
712+
713+
Notes
714+
-----
715+
Due to Python rules, it is not possible to overload the non-equality symbol `!=` for hashable objects,
716+
so `neq` must always be used to compute the Elemwise non-equality of TensorVariables (which are hashable).
717+
"""
712718

713719

714720
def isnan(a):

0 commit comments

Comments
 (0)