forked from apache/mxnet
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
…he#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.
- Loading branch information
1 parent
df62713
commit 3a46f6c
Showing
14 changed files
with
184 additions
and
75 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -53,7 +53,6 @@ export NDArray, | |
clip, | ||
clip!, | ||
context, | ||
empty, | ||
expand_dims, | ||
@inplace, | ||
# activation funcs | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.