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

Julia: rename mx.clip to clamp for NDArray #14027

Merged
merged 1 commit into from
Mar 11, 2019
Merged

Julia: rename mx.clip to clamp for NDArray #14027

merged 1 commit into from
Mar 11, 2019

Conversation

iblislin
Copy link
Member

  • in order to match Base interface

  • depwarn for mx.clip included

Checklist

  • Changes are complete
  • 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:https://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

- in order to match Julia `Base.clamp` interface

- depwarn for `mx.clip` included
Copy link
Member

@eric-haibin-lin eric-haibin-lin left a comment

Choose a reason for hiding this comment

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

Hi, what is the motivation for renaming the API?

@iblislin
Copy link
Member Author

iblislin commented Feb 1, 2019

There is a API named clamp, which functionality is same as mx.clip, in Julia's stdlib.

e.g.

julia> A = [1,2,3,4,5]
5-element Array{Int64,1}:
 1
 2
 3
 4
 5

julia> clamp.(A, 3, 4)
5-element Array{Int64,1}:
 3
 3
 3
 4
 4

So I renamed and make it overload the clamp function for type NDArray.

@vandanavk
Copy link
Contributor

@mxnet-label-bot add [pr-awaiting-review]

@marcoabreu marcoabreu added the pr-awaiting-review PR is waiting for code review label Feb 5, 2019
@larroy
Copy link
Contributor

larroy commented Feb 12, 2019

Why not leave both?

@iblislin
Copy link
Member Author

I'm ok if making aliasing is an acceptable option.

Copy link
Contributor

@larroy larroy left a comment

Choose a reason for hiding this comment

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

LGTM, this is a matter of taste, so up to @iblis17

@wkcn wkcn merged commit af41af5 into master Mar 11, 2019
@wkcn
Copy link
Member

wkcn commented Mar 11, 2019

This PR has been merged.
Thanks for your contribution!

@szha szha deleted the ib/base-clamp branch March 17, 2019 19:54
vdantu pushed a commit to vdantu/incubator-mxnet that referenced this pull request Mar 31, 2019
- in order to match Julia `Base.clamp` interface

- depwarn for `mx.clip` included
nswamy pushed a commit that referenced this pull request Apr 5, 2019
- in order to match Julia `Base.clamp` interface

- depwarn for `mx.clip` included
haohuanw pushed a commit to haohuanw/incubator-mxnet that referenced this pull request Jun 23, 2019
- in order to match Julia `Base.clamp` interface

- depwarn for `mx.clip` included
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Julia NDArray pr-awaiting-review PR is waiting for code review
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

7 participants