Exemple #1
0
    def any(self):
        """Test whether any element not equal zero.

        Returns:
            bool: True if any element is not equal zero, False otherwise.

        """
        ret = ti.cmp_ne(self.entries[0], 0)
        for i in range(1, len(self.entries)):
            ret = ret + ti.cmp_ne(self.entries[i], 0)
        return -ti.cmp_lt(ret, 0)
Exemple #2
0
 def any(self):
     import taichi as ti
     ret = ti.cmp_ne(self.entries[0], 0)
     for i in range(1, len(self.entries)):
         ret = ret + ti.cmp_ne(self.entries[i], 0)
     return -ti.cmp_lt(ret, 0)
Exemple #3
0
 def __lt__(self, other):
     import taichi as ti
     return ti.cmp_lt(self, other)
Exemple #4
0
 def __lt__(self, other):
     _taichi_skip_traceback = 1
     return ti.cmp_lt(self, other)
Exemple #5
0
 def __lt__(self, other):
     import taichi as ti
     _taichi_skip_traceback = 1
     return ti.cmp_lt(self, other)