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

findmax does not squeeze out singleton index #18884

Closed
floswald opened this issue Oct 12, 2016 · 2 comments
Closed

findmax does not squeeze out singleton index #18884

floswald opened this issue Oct 12, 2016 · 2 comments

Comments

@floswald
Copy link

i'm not sure whether this is intended but I think findmax does not conform to the new rule on singleton indices:

julia> x = rand(2,2,2)
2×2×2 Array{Float64,3}:
[:, :, 1] =
 0.319551  0.616412
 0.740493  0.112079

[:, :, 2] =
 0.0639773  0.376866
 0.475386   0.46051 

julia> z = findmax(x,2);

julia> z[1]
2×1×2 Array{Float64,3}:
[:, :, 1] =
 0.616412
 0.740493

[:, :, 2] =
 0.376866
 0.475386

I would expect a (2,2), i.e. the scalar dim should be squeezed out.

julia> versioninfo()
Julia Version 0.5.0
Commit 3c9d753 (2016-09-19 18:14 UTC)
Platform Info:
  System: Darwin (x86_64-apple-darwin13.4.0)
  CPU: Intel(R) Core(TM) i7-4790K CPU @ 4.00GHz
  WORD_SIZE: 64
  BLAS: libopenblas (USE64BITINT DYNAMIC_ARCH NO_AFFINITY Haswell)
  LAPACK: libopenblas64_
  LIBM: libopenlibm
  LLVM: libLLVM-3.7.1 (ORCJIT, haswell)

(sorry for posting on a merged PR before - deleted comment)

@simonster
Copy link
Member

sum, maximum, etc. don't either. The behavior of reductions was intentionally not changed. See #13612 (comment)

@floswald
Copy link
Author

ah ok i see. thanks.

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

No branches or pull requests

2 participants