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

reduce(...; dims=...) doesn't check for invalid dims #37380

Open
stevengj opened this issue Sep 3, 2020 · 1 comment
Open

reduce(...; dims=...) doesn't check for invalid dims #37380

stevengj opened this issue Sep 3, 2020 · 1 comment
Labels
domain:error messages Better, more actionable error messages domain:fold sum, maximum, reduce, foldl, etc.

Comments

@stevengj
Copy link
Member

stevengj commented Sep 3, 2020

It seems like this should throw an exception:

julia> reduce(max, rand(3,4), dims=42)
3×4 Matrix{Float64}:
 0.27254   0.151595  0.800565  0.415303
 0.230914  0.546007  0.135317  0.107762
 0.701839  0.769241  0.875562  0.0847975

and probably also this:

julia> reduce(max, rand(3,4), dims=(1,2,2,2,2))
1×1 Matrix{Float64}:
 0.8197478258634205

(I noticed this in connection with #37367, which does check its dims argument.)

@stevengj stevengj added domain:error messages Better, more actionable error messages domain:fold sum, maximum, reduce, foldl, etc. labels Sep 3, 2020
@rohanblueboybaijal
Copy link

Hi!
Is anyone working on this issue?
Would an error message suffice? And if so, should I be making changes in reduce.jl?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
domain:error messages Better, more actionable error messages domain:fold sum, maximum, reduce, foldl, etc.
Projects
None yet
Development

No branches or pull requests

2 participants