def sum(): for i, j in x: c[None] += ti.is_active(bm, [i, j]) s[None] += x[i, j]
def is_active(): c[None] = ti.is_active(a_a, [0])
def func(): for i in range(n * n): s[None] += ti.is_active(x.parent().parent(), i)