Skip to content

Commit

Permalink
[PYTHON/API] Add compare and logic build-in op for Expr (#39)
Browse files Browse the repository at this point in the history
* [PYTHON/API] Add compare and logic build-in op for Expr

* remove 'and', 'or'
  • Loading branch information
Ziheng Jiang authored and tqchen committed Feb 10, 2017
1 parent 45597d0 commit 526ff04
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions python/tvm/expr.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,24 @@ def __rtruediv__(self, other):
def __neg__(self):
return self.__mul__(-1)

def __lt__(self, other):
return _make.LT(self, other)

def __le__(self, other):
return _make.LE(self, other)

def __eq__(self, other):
return _make.EQ(self, other)

def __ne__(self, other):
return _make.NE(self, other)

def __gt__(self, other):
return _make.GT(self, other)

def __ge__(self, other):
return _make.GE(self, other)


class Expr(NodeBase, ExprOp):
pass
Expand Down

0 comments on commit 526ff04

Please sign in to comment.