-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
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
Fix #4270 #9271
Fix #4270 #9271
Conversation
It's a bit unsatisfying to need a staged function for something so simple. This function has always seemed marginal anyway. Do you find |
Unfortunately my life is full of 4, 5, and 6 dimensional arrays. I often use I think we can get type inference without a staged function if we annotate the tuple passed to |
Here's the variant without a |
@@ -142,20 +142,32 @@ reshape(a::AbstractArray, dims::Int...) = reshape(a, dims) | |||
vec(a::AbstractArray) = reshape(a,length(a)) | |||
vec(a::AbstractVector) = a | |||
|
|||
function squeeze(A::AbstractArray, dims) | |||
argtail(x, rest...) = rest |
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.
These are actually already defined elsewhere in Base.
This is nicer; I'm fine with this version. |
This also makes
squeeze
require a tuple and deprecates the version that takes an iterator. I doubt there are many instances where thedimensions to be squeezed aren't constant.