iblis17 opened a new pull request #13934: Julia: deprecate `mx.empty`, replace it with `UndefInitializer` URL: https://github.com/apache/incubator-mxnet/pull/13934 In Julia 0.7+, constructing a uninitialized array is provided via the APIs: - `Array{T,N}(undef, dims...)` - `Array{T,N}(undef, dims)` - `Array{T}(undef, dims...)` - `Array{T}(undef, dims)` There is an API `mx.empty(dims...)` serving for this purpose. This PR proposes that deprecating the original API `mx.empty` and provide the functionality with the API design similar to Julia's Base. - `NDArray{T,N}(undef, dims...)` - `NDArray{T,N}(undef, dims)` - `NDArray{T}(undef, dims...)` - `NDArray{T}(undef, dims)` - `NDArray(undef, dims...)` - `NDArray(undef, dims)` e.g. ```julia julia> NDArray{Int,2}(undef, 5, 2) 5×2 NDArray{Int64,2} @ CPU0: 94290755905104 94290752678143 94290752660544 68719476760 94290752674408 94290737734368 94290752660544 18 94290752674408 18 julia> NDArray(undef, 5, 2) # default type is `mx.MX_float` 5×2 NDArray{Float32,2} @ CPU0: -29112.406f0 5.2029858f-8 3.0763f-41 6.7375383f-10 1.7613131f19 0.0f0 4.840456f30 0.0f0 4.4262863f30 0.0f0 ``` - The original `mx.empty` APIs are still functional. If user invokes them, a deprecation warning will be popped up. ## 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) - [x] Changes are complete (i.e. I finished coding on this PR) - [x] 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) - [x] 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 - [x] To the my best knowledge, examples are either not affected by this change, or have been fixed to be compatible with this change
---------------------------------------------------------------- This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services