-
-
Notifications
You must be signed in to change notification settings - Fork 117
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
Backport reshape and ntuple Val() APIs to 0.5 and 0.6 #399
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}) | ||
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 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 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?