* Add same_as to NodeBase 1. Most class inherited from NodeBase(Schedule, Stage, etc) still have the convenience of using '==' for object identity. And this is the right behavior for non-Expr classes. 2. subclasses of ExprOp now create EQ expression when '==' is used. `__nonzero__` and `__bool__` in EQ and NE is a comprise that in some cases object identity semantics is still useful, like in unit test. For instance: ```` assert a == b ```` "a == b" will create EQ expression, assert then calls `__nonzero__` of the result expression. `Expr.__nonzero__` throws exception since it prohibits evaluating IR expression. More complex case like: ```` assert a in b # b is dict ```` it will call `__eq__` on a and all keys of b, then `__bool__` on the result expression. This could not easily be done by same_as. * Retain __hash__ from NodeBase in Python3
Name |
Last commit
|
Last update |
---|---|---|
.. | ||
_ffi | Loading commit data... | |
contrib | Loading commit data... | |
exec | Loading commit data... | |
__init__.py | Loading commit data... | |
_api_internal.py | Loading commit data... | |
api.py | Loading commit data... | |
arith.py | Loading commit data... | |
build_module.py | Loading commit data... | |
codegen.py | Loading commit data... | |
container.py | Loading commit data... | |
expr.py | Loading commit data... | |
intrin.py | Loading commit data... | |
ir_builder.py | Loading commit data... | |
ir_pass.py | Loading commit data... | |
make.py | Loading commit data... | |
module.py | Loading commit data... | |
ndarray.py | Loading commit data... | |
node.py | Loading commit data... | |
schedule.py | Loading commit data... | |
stmt.py | Loading commit data... | |
tag.py | Loading commit data... | |
target.py | Loading commit data... | |
tensor.py | Loading commit data... | |
tensor_intrin.py | Loading commit data... |