Skip to content
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

have dropdims default to dropping all singleton dimensions #29547

Closed
wants to merge 1 commit into from

Conversation

lstagner
Copy link
Contributor

@lstagner lstagner commented Oct 6, 2018

I honestly just got really tired of writing the same patterndropdims(sum(x,dims=(1,2)),dims=(1,2)). This makes it so that dropdims will just drop the dims.

@timholy
Copy link
Member

timholy commented Oct 6, 2018

See #22000 and https://stackoverflow.com/questions/52505760/dropping-singleton-dimensions-in-julia/52515948?noredirect=1#comment91975665_52515948.

But of course you can define dropdims1 in your own code if you like.

@timholy timholy closed this Oct 6, 2018
@lstagner
Copy link
Contributor Author

lstagner commented Oct 6, 2018

Ok so the basic problem is that the generated keyword argument isn't type stable because it can't know the length of the tuple a priori.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants