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

Commit 8c06164

Browse files
committed
Fix lint
1 parent 621bc99 commit 8c06164

File tree

6 files changed

+19
-19
lines changed

6 files changed

+19
-19
lines changed

python/mxnet/ndarray/numpy/_op.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4907,5 +4907,5 @@ def nonzero(a):
49074907
>>> (a > 3).nonzero()
49084908
(array([1, 1, 1, 2, 2, 2], dtype=int64), array([0, 1, 2, 0, 1, 2], dtype=int64))
49094909
"""
4910-
indices = _npi.nonzero(a).transpose()
4911-
return tuple([indices[i] for i in range(len(indices))])
4910+
out = _npi.nonzero(a).transpose()
4911+
return tuple([out[i] for i in range(len(out))])

python/mxnet/ndarray/numpy/random.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727

2828

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

8989

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

144144

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

195195

196196
def multinomial(n, pvals, size=None):
197-
"""multinomial(n, pvals, size=None)
197+
r"""multinomial(n, pvals, size=None)
198198
199199
Draw samples from a multinomial distribution.
200200
@@ -246,7 +246,7 @@ def multinomial(n, pvals, size=None):
246246

247247

248248
def choice(a, size=None, replace=True, p=None, ctx=None, out=None):
249-
"""Generates a random sample from a given 1-D array
249+
r"""Generates a random sample from a given 1-D array
250250
251251
Parameters
252252
-----------

python/mxnet/numpy/multiarray.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6900,5 +6900,5 @@ def nonzero(a):
69006900
>>> (a > 3).nonzero()
69016901
(array([1, 1, 1, 2, 2, 2], dtype=int64), array([0, 1, 2, 0, 1, 2], dtype=int64))
69026902
"""
6903-
indices = _npi.nonzero(a).transpose()
6904-
return tuple([indices[i] for i in range(len(indices))])
6903+
out = _npi.nonzero(a).transpose()
6904+
return tuple([out[i] for i in range(len(out))])

python/mxnet/numpy/random.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424

2525

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

7777

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

133133

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

201201

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

243243

244244
def choice(a, size=None, replace=True, p=None, ctx=None, out=None):
245-
"""Generates a random sample from a given 1-D array
245+
r"""Generates a random sample from a given 1-D array
246246
247247
Parameters
248248
-----------

python/mxnet/numpy_extension/random.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525

2626

2727
def seed(seed, ctx='all'): # pylint: disable=redefined-outer-name
28-
"""Seeds the random number generators in MXNet.
28+
r"""Seeds the random number generators in MXNet.
2929
3030
This affects the behavior of modules in MXNet that uses random number generators,
3131
like the dropout operator and `ndarray`'s random sampling operators.

python/mxnet/symbol/numpy/random.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525

2626

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

114114

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

169169

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

218218

219219
def choice(a, size=None, replace=True, p=None, ctx=None, out=None):
220-
"""Generates a random sample from a given 1-D array
220+
r"""Generates a random sample from a given 1-D array
221221
222222
Parameters
223223
-----------

0 commit comments

Comments
 (0)