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

Fix error in validating complex row-first hvncat #45365

Merged
merged 3 commits into from
May 19, 2022

Conversation

BioTurboNick
Copy link
Contributor

@BioTurboNick BioTurboNick commented May 19, 2022

With the validation logic implemented in #43940 , a complex input can fail in row-first mode:

[[1 2; 3 4] [5; 6]; [7 8] 9;;;]
ERROR: ArgumentError: incompatible shape in element 2
Stacktrace:
 [1] _typed_hvncat_dims(#unused#::Type{Int64}, dims::Tuple{Int64, Int64, Int64}, row_first::Bool, as::Tuple{Matrix{Int64}, Vector{Int64}, Matrix{Int64}, Int64})
   @ Base .\abstractarray.jl:2386
 [2] _typed_hvncat(::Type, ::Tuple{Int64, Int64, Int64}, ::Bool, ::Matrix{Int64}, ::Vararg{Any})
   @ Base .\abstractarray.jl:2361
 [3] _hvncat(::Tuple{Int64, Int64, Int64}, ::Bool, ::Matrix{Int64}, ::Vararg{Any})
   @ Base .\abstractarray.jl:2190
 [4] hvncat(::Tuple{Int64, Int64, Int64}, ::Bool, ::Matrix{Int64}, ::Vararg{Any})
   @ Base .\abstractarray.jl:2186
 [5] top-level scope
   @ REPL[39]:1

# Expected
3×3×1 Array{Int64, 3}:
[:, :, 1] =
 1  2  5
 3  4  6
 7  8  9

This was due to failing to adjust the check for the row first mode. This PR fixes it.

This should probably be backported into 1.8 and 1.7.3 before release.

@BioTurboNick BioTurboNick mentioned this pull request May 19, 2022
67 tasks
@oscardssmith oscardssmith added bugfix This change fixes an existing bug backport 1.7 backport 1.8 Change should be backported to release-1.8 labels May 19, 2022
@KristofferC KristofferC merged commit 0f2ed77 into JuliaLang:master May 19, 2022
KristofferC pushed a commit that referenced this pull request May 23, 2022
@KristofferC KristofferC removed the backport 1.8 Change should be backported to release-1.8 label May 26, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bugfix This change fixes an existing bug
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants