diff --git a/python/taichi/lang/expr.py b/python/taichi/lang/expr.py index 6e978b0b17f320..6da9e879e9c980 100644 --- a/python/taichi/lang/expr.py +++ b/python/taichi/lang/expr.py @@ -46,16 +46,16 @@ def stack_info(): # remove the confusing last line return '\n'.join(raw.split('\n')[:-3]) + '\n' + def __neg__(self): + import taichi as ti + return ti.neg(self) + def __add__(self, other): import taichi as ti return ti.add(self, other) __radd__ = __add__ - def __neg__(self): - import taichi as ti - return ti.neg(self) - def __sub__(self, other): import taichi as ti return ti.sub(self, other)