def test_argsort(): # Sort does not support 64bit int yet x = np.array([3, 1, 2], dtype=float) y = af.array(x) iassert(af.argsort(y), np.argsort(x)) x = np.array([[0, 3], [2, 2]], dtype=float) y = af.array(x) iassert(af.argsort(y), np.argsort(x)) iassert(af.argsort(y, axis=1), np.argsort(x, axis=1))
def test_sort_xfail(): x = np.array([[0, 3], [2, 2]], dtype=float) y = af.array(x) # Arrayfire at the moment can only sort along the last dimension iassert(af.argsort(y, axis=0), np.argsort(x, axis=0))