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

Commit

Permalink
move matrix generator to utils
Browse files Browse the repository at this point in the history
  • Loading branch information
Ubuntu committed Jul 23, 2020
1 parent b615229 commit 8bbc53b
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
7 changes: 7 additions & 0 deletions python/mxnet/test_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -297,6 +297,13 @@ def create_vector(size, dtype=np.int64):
a = mx.nd.arange(0, size, dtype=dtype)
return a

# For testing Large Square Matrix with total size > 2^32 elements
def get_large_identity_mat():
A = nd.zeros((LARGE_SQ_X, LARGE_SQ_X))
for i in range(LARGE_SQ_X):
A[i,i] = 1
return A

def rand_sparse_ndarray(shape, stype, density=None, dtype=None, distribution=None,
data_init=None, rsp_indices=None, modifier_func=None,
shuffle_csr_indices=False, ctx=None):
Expand Down
6 changes: 0 additions & 6 deletions tests/nightly/test_large_array.py
Original file line number Diff line number Diff line change
Expand Up @@ -1170,12 +1170,6 @@ def check_correctness(mxnet_op, numpy_op, atol=1e-3):


def test_linalg():
def get_large_identity_mat():
A = nd.zeros((LARGE_SQ_X, LARGE_SQ_X))
for i in range(LARGE_SQ_X):
A[i,i] = 1
return A

def batchify(mat):
return nd.array([mat.asnumpy()])

Expand Down

0 comments on commit 8bbc53b

Please sign in to comment.