[FRONTEND] Add reverse eq and ne (#2563)

This commit is contained in:
Keren Zhou
2023-10-30 16:56:43 -04:00
committed by GitHub
parent 12f906287f
commit 492886fcde
2 changed files with 13 additions and 3 deletions

View File

@@ -720,11 +720,21 @@ class tensor:
other = _to_tensor(other, _builder)
return semantic.equal(self, other, _builder)
@builtin
def __req__(self, other, _builder=None):
other = _to_tensor(other, _builder)
return semantic.equal(other, self, _builder)
@builtin
def __ne__(self, other, _builder=None):
other = _to_tensor(other, _builder)
return semantic.not_equal(self, other, _builder)
@builtin
def __rne__(self, other, _builder=None):
other = _to_tensor(other, _builder)
return semantic.not_equal(other, self, _builder)
@builtin
def logical_and(self, other, _builder=None):
other = _to_tensor(other, _builder)