示例#1
0
    def __rsub__(self, other):
        if self.is_pyconstant() and in_python_scope():
            return self.make_from_numpy(
                numpy_or_constant(other) - self.to_numpy())

        import taichi as ti
        return ti.sub(other, self)
示例#2
0
    def __sub__(self, other):
        if self.is_pyconstant():
            return self.make_from_numpy(self.to_numpy() -
                                        numpy_or_constant(other))

        import taichi as ti
        return ti.sub(self, other)
示例#3
0
 def __rsub__(self, other):
     import taichi as ti
     return ti.sub(other, self)
示例#4
0
 def __sub__(self, other):
     import taichi as ti
     return ti.sub(self, other)
示例#5
0
 def __rsub__(self, other):
     _taichi_skip_traceback = 1
     return ti.sub(other, self)
示例#6
0
 def __rsub__(self, other):
     import taichi as ti
     _taichi_skip_traceback = 1
     return ti.sub(other, self)