Esempio n. 1
0
def test_moveaxis_error(source, destination):
    x = sparse.random((2, 3, 4), density=0.25)

    with pytest.raises(ValueError):
        sparse.moveaxis(x, source, destination)
Esempio n. 2
0
def test_moveaxis_error(source, destination, x):

    with pytest.raises(ValueError):
        sparse.moveaxis(x, source, destination)
Esempio n. 3
0
def test_moveaxis(source, destination):
    x = sparse.random((2, 3, 4, 5), density=0.25)
    y = x.todense()
    xx = sparse.moveaxis(x, source, destination)
    yy = np.moveaxis(y, source, destination)
    assert_eq(xx, yy)
Esempio n. 4
0
def test_moveaxis(source, destination, x):
    y = x.todense()
    xx = sparse.moveaxis(x, source, destination)
    yy = np.moveaxis(y, source, destination)
    assert_eq(xx, yy)