예제 #1
0
파일: test_core.py 프로젝트: daurer/afnumpy
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))
예제 #2
0
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))
예제 #3
0
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))