def get_vn_cell_v2(vecs):
vecs = np.asarray(vecs)
res = np.zeros_like(vecs)
x_larger = vecs[..., 0] > vecs[..., 1]
res[x_larger, 0] = np.sign(vecs[x_larger, 0])
res[~x_larger, 1] = np.sign(vecs[~x_larger, 1])
return res
inp = np.array([[[0, 0], [0, 1]], [[45, 30], [-2, 3]]])
np.array_equal(get_vn_cell(inp), get_vn_cell_v2(inp)) # True