Skip to content

reshape with zero dimensions #45589

Open
Open

Description

I think this should be able to return without error.

julia> reshape(randn(0,4),0,:)
ERROR: DivideError: integer division error
Stacktrace:
 [1] div
   @ ./int.jl:284 [inlined]
 [2] divrem
   @ ./div.jl:162 [inlined]
 [3] divrem
   @ ./div.jl:158 [inlined]
 [4] _reshape_uncolon
   @ ./reshapedarray.jl:127 [inlined]
 [5] reshape(parent::Matrix{Float64}, dims::Tuple{Int64, Colon})
   @ Base ./reshapedarray.jl:118
 [6] reshape(::Matrix{Float64}, ::Int64, ::Colon)
   @ Base ./reshapedarray.jl:117
 [7] top-level scope
   @ REPL[1]:1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

No one assigned

    Labels

    arrays[a, r, r, a, y, s]bugIndicates an unexpected problem or unintended behavior

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions