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(hcat, ...) errors #177

Open
stillyslalom opened this issue Aug 3, 2021 · 2 comments
Open

reduce(hcat, ...) errors #177

stillyslalom opened this issue Aug 3, 2021 · 2 comments

Comments

@stillyslalom
Copy link

julia> ThreadsX.reduce(hcat, [rand(3), rand(3)])
ERROR: DimensionMismatch("mismatch in dimension 1 (expected 1 got 3)")

This is a common idiom for concatenating arrays of arrays. reduce(vcat, ...) runs, but produces incorrect results that point to the source of the error for hcat:

julia> ThreadsX.reduce(vcat, [rand(3), rand(3)])
8-element Vector{Union{InitialValues.InitialValueOf{typeof(vcat)}, Float64}}:
  InitialValue(vcat)
 0.7140306092023179
 0.8995936786278651
 0.5841323215816541
  InitialValue(vcat)
 0.45848307169563784
 0.685422666949578
 0.763444779970013
@tkf
Copy link
Owner

tkf commented Aug 3, 2021

This probably needs a direct implementation, as Base does.

@kescobo
Copy link

kescobo commented Aug 4, 2022

Perhaps unsurprisingly, this is also a problem with ThreadsX.mapreduce that I ran into as well.

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

3 participants