def update(u): v = u * enzyme.ones([3,2]) return enzyme.roll(v, -1, axis=1).mean(0).mean()
def update(u): v = u * enzyme.ones([3,2]) return v.T.sum(1).sum() + v.transpose().mean(1).mean()