Skip to content
This repository has been archived by the owner on Nov 17, 2023. It is now read-only.

Commit

Permalink
removing skipped tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Rohit Kumar Srivastava committed Aug 21, 2019
1 parent 87473a9 commit 9bff00f
Showing 1 changed file with 8 additions and 37 deletions.
45 changes: 8 additions & 37 deletions tests/nightly/test_large_vector.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
# dimension constants
LARGE_X = 5000000000
MEDIUM_X = 1000000000
LARGE_Y = 100000
SMALL_Y = 1


Expand All @@ -35,12 +36,12 @@ def test_slice():


def test_gluon_embedding():
m = gluon.nn.Embedding(SMALL_Y, MEDIUM_X)
m = gluon.nn.Embedding(1, LARGE_Y)
m.initialize()
a = nd.zeros((MEDIUM_X, SMALL_Y))
a = nd.zeros((LARGE_Y, 1))
b = m(a)
assert b.shape == (MEDIUM_X, SMALL_Y, MEDIUM_X)
assert b.asnumpy().size == LARGE_SIZE
assert b.shape == (LARGE_Y, 1, LARGE_Y)
assert b.asnumpy().size == LARGE_X*2


def test_ndarray_zeros():
Expand All @@ -51,26 +52,15 @@ def test_ndarray_zeros():


def test_ndarray_ones():
a = nd.ones(shape=(LARGE_X))
assert a[-1][0] == 1
a = nd.ones(shape=LARGE_X)
assert a[-1] == 1
assert nd.sum(a).asnumpy() == LARGE_X


@unittest.skip("need to fix")
def test_ndarray_convert():
a = nd.zeros(shape=(LARGE_X, SMALL_Y))
b = a.astype(np.int32)
b.wait_to_read()
assert b.dtype == np.int32
b = a.tostype('row_sparse')
b.wait_to_read()
assert isinstance(b, mx.nd.sparse.RowSparseNDArray)


@with_seed()
def test_ndarray_random_uniform():
a = nd.random.uniform(shape=LARGE_X)
assert a[-1][0] != 0
assert a[-1] != 0


@with_seed()
Expand Down Expand Up @@ -107,14 +97,6 @@ def test_reduce():
assert nd.sum(a).asnumpy() == a.shape[0] * a.shape[1]


@unittest.skip("need to fix")
def test_dot():
a = nd.ones(shape=(LARGE_X, SMALL_Y))
b = nd.ones(shape=(SMALL_Y, SMALL_Y))
res = nd.dot(a, b)
assert np.sum(res[-1].asnumpy() == SMALL_Y) == b.shape[1]


def test_FullyConnected():
a = nd.ones(shape=(LARGE_X, SMALL_Y))
b = nd.ones(shape=(SMALL_Y, SMALL_Y))
Expand Down Expand Up @@ -200,17 +182,6 @@ def test_Dense(ctx=mx.cpu(0)):
assert res.shape == (LARGE_X, 2)


@unittest.skip("need to fix")
def test_where():
a = nd.ones(shape=(LARGE_X, SMALL_Y))
b = nd.arange(0, LARGE_X * SMALL_Y).reshape(LARGE_X, SMALL_Y)
res = nd.where(b > 100, a, b)
assert np.sum(res[-1].asnumpy() == 1) == b.shape[1]
csr_cond = nd.sparse.cast_storage(b < 10, 'csr')
res = nd.sparse.where(csr_cond, a, b)
assert np.sum(res[0].asnumpy() == 1) == 10


def test_pick():
a = mx.nd.ones(shape=(LARGE_X, 2))
b = mx.nd.ones(shape=LARGE_X)
Expand Down

0 comments on commit 9bff00f

Please sign in to comment.