tlby opened a new pull request #15395: [Perl] - simplify aliasing strategy
URL: https://github.com/apache/incubator-mxnet/pull/15395
 
 
   ## Description ##
   There is some unnecessary complexity in the shorthand aliasing scheme this 
work aims to correct.  We expect `mx->nd->array(...)` and 
`AI::MXNet::NDArray->array(...)` to be functionally equivalent and they are, 
but there are edge cases where the methods supported by the short and long 
names don't exactly align.
   
   ## Checklist ##
   ### Essentials ###
   Please feel free to remove inapplicable items for your PR.
   - [ ] The PR title starts with [MXNET-$JIRA_ID], where $JIRA_ID refers to 
the relevant [JIRA issue](https://issues.apache.org/jira/projects/MXNET/issues) 
created (except PRs with tiny changes)
   - [ ] 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 ###
   - [x] Responsibility of short name aliases moved from importer to imported 
module.
   - [x] Retool constructor shorthand aliases to use `AUTOLOAD` rather than 
dynamic method creation to avoid namespace collisions between class and 
function names.  For example, `AI::MXNet::Context` the class vs. 
`AI::MXNet->Context()` the shorthand for `AI::MXNet::Context->new()`.
   - [x] Folds the '_' suffixed shadow classes enhancements into the full name 
classes.
   - [x] Retool of `register()` methods to not mangle stack traces.
   
   ## Comments ##
   - I believe these changes are backwards compatible to the documented API, 
and brings the API as a whole closer to the designed intent.
   - Interesting edge cases to note here, I was unable to convert 
`AI::MXNet::Gluon::Block->register()` to use the `AUTOLOAD` scheme even though 
it seems to need the same class vs. method collision avoidance as in other 
places.  Hopefully this can be dealt with in a future effort.
   

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

Reply via email to