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

Numpy det and slogdet operator #15861

Merged
merged 3 commits into from
Sep 25, 2019
Merged

Numpy det and slogdet operator #15861

merged 3 commits into from
Sep 25, 2019

Conversation

ckt624
Copy link
Contributor

@ckt624 ckt624 commented Aug 12, 2019

Description

Implements numpy.linalg.det and slogdet. See
https://docs.scipy.org/doc/numpy/reference/generated/numpy.linalg.det.html
https://docs.scipy.org/doc/numpy/reference/generated/numpy.linalg.slogdet.html

Checklist

Essentials

Please feel free to remove inapplicable items for your PR.

  • Changes are complete (i.e. I finished coding on this PR)
  • All changes have test coverage:
  • Unit tests are added for small changes to verify correctness (e.g. adding a new operator)
  • Nightly tests are added for complicated/long-running ones (e.g. changing distributed kvstore)
  • Build tests will be added for build configuration changes (e.g. adding a new build option with NCCL)
  • Code is well-documented:
  • For user-facing API changes, API doc string has been updated.
  • For new C++ functions in header files, their functionalities and arguments are documented.
  • For new examples, README.md is added to explain the what the example does, the source of the dataset, expected performance on test set and reference to the original paper if applicable
  • Check the API doc at http://mxnet-ci-doc.s3-accelerate.dualstack.amazonaws.com/PR-$PR_ID/$BUILD_ID/index.html
  • To the my best knowledge, examples are either not affected by this change, or have been fixed to be compatible with this change

Changes

  • Implements numpy.linalg.det
  • Implements numpy.linalg.slogdet

Comments

@haojin2 @reminisce

@ckt624 ckt624 requested a review from szha as a code owner August 12, 2019 13:13
@haojin2 haojin2 self-assigned this Aug 12, 2019
@haojin2 haojin2 requested review from haojin2 and reminisce and removed request for szha August 12, 2019 18:36
@haojin2 haojin2 added the Numpy label Aug 12, 2019
@haojin2
Copy link
Contributor

haojin2 commented Aug 12, 2019

Some tests are failing, please investigate.

src/operator/tensor/la_op.cc Outdated Show resolved Hide resolved
src/operator/tensor/la_op.cc Outdated Show resolved Hide resolved
src/operator/tensor/la_op.cu Outdated Show resolved Hide resolved
src/operator/tensor/la_op.cu Outdated Show resolved Hide resolved
@reminisce
Copy link
Contributor

I think you will need to modify the DetShape function so that np.linalg.det returns a scalar tensor when ndim=2. You can just add a check of is_np_shape in the following and set TShape(0, 1) to the output shape.
https://github.com/apache/incubator-mxnet/blob/c3f5eeabf9bf9d37ac47a4f1c8cc93c292825d2a/src/operator/tensor/la_op.h#L431

@ckt624 ckt624 force-pushed the master_det branch 5 times, most recently from e5bee2d to 46f9d54 Compare August 14, 2019 06:01
@ckt624 ckt624 force-pushed the master_det branch 2 times, most recently from 86e269a to 0a4c9da Compare August 17, 2019 08:59
@reminisce reminisce changed the base branch from master to numpy_prs September 24, 2019 23:07
ckt624 and others added 2 commits September 24, 2019 16:08
Add tests.

Add slogdet tests.

Add docs

Change shapes

Change tests.

Change slogdet tests

Change style.
@reminisce reminisce merged commit a2a1b68 into apache:numpy_prs Sep 25, 2019
reminisce pushed a commit that referenced this pull request Oct 5, 2019
* Add alias.

Add tests.

Add slogdet tests.

Add docs

Change shapes

Change tests.

Change slogdet tests

Change style.

* Fix

* Fix
reminisce pushed a commit that referenced this pull request Oct 6, 2019
* Add alias.

Add tests.

Add slogdet tests.

Add docs

Change shapes

Change tests.

Change slogdet tests

Change style.

* Fix

* Fix
reminisce pushed a commit that referenced this pull request Oct 7, 2019
* Add alias.

Add tests.

Add slogdet tests.

Add docs

Change shapes

Change tests.

Change slogdet tests

Change style.

* Fix

* Fix
reminisce added a commit to reminisce/mxnet that referenced this pull request Oct 9, 2019
@reminisce reminisce mentioned this pull request Oct 10, 2019
7 tasks
reminisce added a commit that referenced this pull request Oct 10, 2019
* Revert "Numpy det and slogdet operators (#15861)"

This reverts commit 295fc14.

* Delete non-windows test

* Revert "Numpy Operators: Inner, Outer, vdot (#15846)"

This reverts commit 2df3282.

* Revert "Revert "Numpy Operators: Inner, Outer, vdot (#15846)""

This reverts commit 79ceaa7.

* Revert "Delete non-windows test"

This reverts commit c915877.
aaronmarkham pushed a commit to aaronmarkham/incubator-mxnet that referenced this pull request Oct 16, 2019
* Revert "Numpy det and slogdet operators (apache#15861)"

This reverts commit 295fc14.

* Delete non-windows test

* Revert "Numpy Operators: Inner, Outer, vdot (apache#15846)"

This reverts commit 2df3282.

* Revert "Revert "Numpy Operators: Inner, Outer, vdot (apache#15846)""

This reverts commit 79ceaa7.

* Revert "Delete non-windows test"

This reverts commit c915877.
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.

3 participants