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

extend ndarray in-place reshape #10360

Merged
merged 5 commits into from
Apr 4, 2018
Merged

extend ndarray in-place reshape #10360

merged 5 commits into from
Apr 4, 2018

Conversation

szha
Copy link
Member

@szha szha commented Apr 1, 2018

Description

extend ndarray in-place reshape

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

  • add MXNDArrayReshape64 which supports extended reshape
  • use new api in arr.reshape

@szha szha requested a review from piiswrong April 1, 2018 23:39
@szha szha requested a review from cjolivier01 as a code owner April 1, 2018 23:39
ctypes.byref(handle)))
check_call(_LIB.MXNDArrayReshape64(self.handle,
len(shape),
c_array(ctypes.c_longlong, shape),
Copy link
Contributor

Choose a reason for hiding this comment

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

does ctypes have c_int64?

0 Dimensions in shape will be copied from original shape, i.e.
if x.shape == (3, 4, 5), x.reshape((0, 20)).shape will be (3, 20).

Some dimensions of the shape can take special values from the set {0, -1, -2, -3, -4}.
Copy link
Contributor

Choose a reason for hiding this comment

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

paste the doc here instead of using link

@szha
Copy link
Member Author

szha commented Apr 2, 2018

@piiswrong piiswrong merged commit 9fee414 into apache:master Apr 4, 2018
@szha szha deleted the arr_reshape branch April 4, 2018 06:37
rahul003 pushed a commit to rahul003/mxnet that referenced this pull request Jun 4, 2018
* refactor reshapeshape

* add extended reshape to c_api

* fix for windows

* avoid arr buf for windows

* update
zheng-da pushed a commit to zheng-da/incubator-mxnet that referenced this pull request Jun 28, 2018
* refactor reshapeshape

* add extended reshape to c_api

* fix for windows

* avoid arr buf for windows

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

Successfully merging this pull request may close these issues.

2 participants