Skip to content

Commit

Permalink
fix default val for distribution (apache#172)
Browse files Browse the repository at this point in the history
  • Loading branch information
eric-haibin-lin committed Aug 17, 2017
1 parent 45045ac commit 53e94c6
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion python/mxnet/test_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@ def _get_powerlaw_dataset_csr(num_rows, num_cols, density=0.1, dtype=None):
return mx.nd.array(output_arr).tostype("csr")


def rand_sparse_ndarray(shape, stype, density=None, distribution="uniform", dtype=None):
def rand_sparse_ndarray(shape, stype, density=None, distribution=None, dtype=None):
"""Generate a random sparse ndarray. Returns the ndarray, value(np) and indices(np)
Parameters
----------
Expand Down Expand Up @@ -216,6 +216,7 @@ def rand_sparse_ndarray(shape, stype, density=None, distribution="uniform", dtyp
"""
density = rnd.rand() if density is None else density
dtype = default_dtype() if dtype is None else dtype
distribution = "uniform" if distribution is None else distribution
if stype == 'row_sparse':
assert (distribution == "uniform"), \
"Distribution %s not supported for row_sparse" % (distribution)
Expand Down

0 comments on commit 53e94c6

Please sign in to comment.