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

Commit

Permalink
Fix lint
Browse files Browse the repository at this point in the history
  • Loading branch information
reminisce committed Oct 27, 2019
1 parent 621bc99 commit 8c06164
Show file tree
Hide file tree
Showing 6 changed files with 19 additions and 19 deletions.
4 changes: 2 additions & 2 deletions python/mxnet/ndarray/numpy/_op.py
Original file line number Diff line number Diff line change
Expand Up @@ -4907,5 +4907,5 @@ def nonzero(a):
>>> (a > 3).nonzero()
(array([1, 1, 1, 2, 2, 2], dtype=int64), array([0, 1, 2, 0, 1, 2], dtype=int64))
"""
indices = _npi.nonzero(a).transpose()
return tuple([indices[i] for i in range(len(indices))])
out = _npi.nonzero(a).transpose()
return tuple([out[i] for i in range(len(out))])
10 changes: 5 additions & 5 deletions python/mxnet/ndarray/numpy/random.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@


def randint(low, high=None, size=None, dtype=None, ctx=None, out=None):
"""Return random integers from `low` (inclusive) to `high` (exclusive).
r"""Return random integers from `low` (inclusive) to `high` (exclusive).
Return random integers from the "discrete uniform" distribution of
the specified dtype in the "half-open" interval [`low`, `high`). If
Expand Down Expand Up @@ -88,7 +88,7 @@ def randint(low, high=None, size=None, dtype=None, ctx=None, out=None):


def uniform(low=0.0, high=1.0, size=None, dtype=None, ctx=None, out=None):
"""Draw samples from a uniform distribution.
r"""Draw samples from a uniform distribution.
Samples are uniformly distributed over the half-open interval
``[low, high)`` (includes low, but excludes high). In other words,
Expand Down Expand Up @@ -143,7 +143,7 @@ def uniform(low=0.0, high=1.0, size=None, dtype=None, ctx=None, out=None):


def normal(loc=0.0, scale=1.0, size=None, dtype=None, ctx=None, out=None):
"""Draw random samples from a normal (Gaussian) distribution.
r"""Draw random samples from a normal (Gaussian) distribution.
Samples are distributed according to a normal distribution parametrized
by *loc* (mean) and *scale* (standard deviation).
Expand Down Expand Up @@ -194,7 +194,7 @@ def normal(loc=0.0, scale=1.0, size=None, dtype=None, ctx=None, out=None):


def multinomial(n, pvals, size=None):
"""multinomial(n, pvals, size=None)
r"""multinomial(n, pvals, size=None)
Draw samples from a multinomial distribution.
Expand Down Expand Up @@ -246,7 +246,7 @@ def multinomial(n, pvals, size=None):


def choice(a, size=None, replace=True, p=None, ctx=None, out=None):
"""Generates a random sample from a given 1-D array
r"""Generates a random sample from a given 1-D array
Parameters
-----------
Expand Down
4 changes: 2 additions & 2 deletions python/mxnet/numpy/multiarray.py
Original file line number Diff line number Diff line change
Expand Up @@ -6900,5 +6900,5 @@ def nonzero(a):
>>> (a > 3).nonzero()
(array([1, 1, 1, 2, 2, 2], dtype=int64), array([0, 1, 2, 0, 1, 2], dtype=int64))
"""
indices = _npi.nonzero(a).transpose()
return tuple([indices[i] for i in range(len(indices))])
out = _npi.nonzero(a).transpose()
return tuple([out[i] for i in range(len(out))])
10 changes: 5 additions & 5 deletions python/mxnet/numpy/random.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@


def randint(low, high=None, size=None, dtype=None, ctx=None, out=None):
"""Return random integers from `low` (inclusive) to `high` (exclusive).
r"""Return random integers from `low` (inclusive) to `high` (exclusive).
Return random integers from the "discrete uniform" distribution of
the specified dtype in the "half-open" interval [`low`, `high`). If
Expand Down Expand Up @@ -76,7 +76,7 @@ def randint(low, high=None, size=None, dtype=None, ctx=None, out=None):


def uniform(low=0.0, high=1.0, size=None, dtype=None, ctx=None, out=None):
"""Draw samples from a uniform distribution.
r"""Draw samples from a uniform distribution.
Samples are uniformly distributed over the half-open interval
``[low, high)`` (includes low, but excludes high). In other words,
Expand Down Expand Up @@ -132,7 +132,7 @@ def uniform(low=0.0, high=1.0, size=None, dtype=None, ctx=None, out=None):


def normal(loc=0.0, scale=1.0, size=None, dtype=None, ctx=None, out=None):
"""Draw random samples from a normal (Gaussian) distribution.
r"""Draw random samples from a normal (Gaussian) distribution.
Samples are distributed according to a normal distribution parametrized
by *loc* (mean) and *scale* (standard deviation).
Expand Down Expand Up @@ -200,7 +200,7 @@ def normal(loc=0.0, scale=1.0, size=None, dtype=None, ctx=None, out=None):


def multinomial(n, pvals, size=None, **kwargs):
"""
r"""
Draw samples from a multinomial distribution.
The multinomial distribution is a multivariate generalisation of the binomial distribution.
Take an experiment with one of ``p`` possible outcomes. An example of such an experiment is throwing a dice,
Expand Down Expand Up @@ -242,7 +242,7 @@ def multinomial(n, pvals, size=None, **kwargs):


def choice(a, size=None, replace=True, p=None, ctx=None, out=None):
"""Generates a random sample from a given 1-D array
r"""Generates a random sample from a given 1-D array
Parameters
-----------
Expand Down
2 changes: 1 addition & 1 deletion python/mxnet/numpy_extension/random.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@


def seed(seed, ctx='all'): # pylint: disable=redefined-outer-name
"""Seeds the random number generators in MXNet.
r"""Seeds the random number generators in MXNet.
This affects the behavior of modules in MXNet that uses random number generators,
like the dropout operator and `ndarray`'s random sampling operators.
Expand Down
8 changes: 4 additions & 4 deletions python/mxnet/symbol/numpy/random.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@


def randint(low, high=None, size=None, dtype=None, ctx=None, out=None):
"""Return random integers from `low` (inclusive) to `high` (exclusive).
r"""Return random integers from `low` (inclusive) to `high` (exclusive).
Return random integers from the "discrete uniform" distribution of
the specified dtype in the "half-open" interval [`low`, `high`). If
Expand Down Expand Up @@ -113,7 +113,7 @@ def rand(*size, **kwargs):


def uniform(low=0.0, high=1.0, size=None, dtype=None, ctx=None, out=None):
"""Draw samples from a uniform distribution.
r"""Draw samples from a uniform distribution.
Samples are uniformly distributed over the half-open interval
``[low, high)`` (includes low, but excludes high). In other words,
Expand Down Expand Up @@ -168,7 +168,7 @@ def uniform(low=0.0, high=1.0, size=None, dtype=None, ctx=None, out=None):


def normal(loc=0.0, scale=1.0, size=None, dtype=None, ctx=None, out=None):
"""Draw random samples from a normal (Gaussian) distribution.
r"""Draw random samples from a normal (Gaussian) distribution.
Samples are distributed according to a normal distribution parametrized
by *loc* (mean) and *scale* (standard deviation).
Expand Down Expand Up @@ -217,7 +217,7 @@ def normal(loc=0.0, scale=1.0, size=None, dtype=None, ctx=None, out=None):


def choice(a, size=None, replace=True, p=None, ctx=None, out=None):
"""Generates a random sample from a given 1-D array
r"""Generates a random sample from a given 1-D array
Parameters
-----------
Expand Down

0 comments on commit 8c06164

Please sign in to comment.