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

[numpy] nonzero #15838

Merged
merged 1 commit into from
Sep 23, 2019
Merged

[numpy] nonzero #15838

merged 1 commit into from
Sep 23, 2019

Conversation

tingying2020
Copy link
Contributor

numpy operator nonzero

@haojin2 haojin2 requested review from haojin2 and reminisce and removed request for szha August 10, 2019 03:05
@haojin2 haojin2 added the Numpy label Aug 10, 2019
np_out = np.nonzero(x.asnumpy())
np_out = np.transpose(np_out)
assert_almost_equal(mx_out.asnumpy(), np_out, rtol, atol)

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One more blank line here.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done.

(1, 1),
(1, 2, 3),
(1, 0),
(2, 0, 3)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Get rid of this shape

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done.

for hybridize in [True, False]:
for shape in [(),
(1,),
(1, 1),
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Get rid of this shape and the shape above.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done.

@tingying2020 tingying2020 force-pushed the ms_nonzero branch 2 times, most recently from aded5c8 to c33b8b0 Compare September 16, 2019 07:38
Copy link
Contributor

@haojin2 haojin2 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM after rebase and resolution of conflicts

@tingying2020 tingying2020 force-pushed the ms_nonzero branch 2 times, most recently from d10c07e to eb41507 Compare September 19, 2019 14:35
@reminisce reminisce changed the base branch from master to numpy_staging_prs September 23, 2019 05:13
* add cpu test and handle 0-dim

* add FGradient with MakeZeroGradNodes

* handle 0-dim and 0-shape and add test on gpu

* add doc

* fix bug in review

* do not use thrust::inclusive_scan on cpu

* fix format error

* edit test and remove gpu test

The output is same as numpy.transpose(numpy.nonzero(x))

* fix error of review

* edit test
@reminisce reminisce merged commit c36819e into apache:numpy_staging_prs Sep 23, 2019
reminisce pushed a commit that referenced this pull request Sep 23, 2019
* add cpu test and handle 0-dim

* add FGradient with MakeZeroGradNodes

* handle 0-dim and 0-shape and add test on gpu

* add doc

* fix bug in review

* do not use thrust::inclusive_scan on cpu

* fix format error

* edit test and remove gpu test

The output is same as numpy.transpose(numpy.nonzero(x))

* fix error of review

* edit test
drivanov pushed a commit to drivanov/incubator-mxnet that referenced this pull request Sep 26, 2019
* add cpu test and handle 0-dim

* add FGradient with MakeZeroGradNodes

* handle 0-dim and 0-shape and add test on gpu

* add doc

* fix bug in review

* do not use thrust::inclusive_scan on cpu

* fix format error

* edit test and remove gpu test

The output is same as numpy.transpose(numpy.nonzero(x))

* fix error of review

* edit test
larroy pushed a commit to larroy/mxnet that referenced this pull request Sep 28, 2019
* add cpu test and handle 0-dim

* add FGradient with MakeZeroGradNodes

* handle 0-dim and 0-shape and add test on gpu

* add doc

* fix bug in review

* do not use thrust::inclusive_scan on cpu

* fix format error

* edit test and remove gpu test

The output is same as numpy.transpose(numpy.nonzero(x))

* fix error of review

* edit test
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants