-
-
Notifications
You must be signed in to change notification settings - Fork 115
Backport reshape and ntuple Val() APIs to 0.5 and 0.6 #399
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 2 commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -461,6 +461,11 @@ end | |
| if VERSION < v"0.7.0-DEV.843" | ||
| import Base: Val | ||
| (::Type{Val})(x) = (Base.@_pure_meta; Val{x}()) | ||
| # Also add methods for Val(x) that were previously Val{x} | ||
| import Base: reshape | ||
| reshape{N}(parent::AbstractArray, ndims::Val{N}) = reshape(parent, Val{N}) | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Shouldn't this be
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is adding a method to support
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Ah, gotcha. Sorry for the noise. |
||
| import Base: ntuple | ||
| ntuple{F,N}(f::F, ::Val{N}) = ntuple(f, Val{N}) | ||
| end | ||
|
|
||
| # https://github.com/JuliaLang/julia/pull/22629 | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
could you put these on separate bullets?