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

Convert VectorOfArray to Array when the size of the last dimension of each Array varies #208

Open
msainsburydale opened this issue Jun 1, 2022 · 1 comment

Comments

@msainsburydale
Copy link

Hi,

Thanks for the module, very nice. I was wondering if there's a way to convert an object of type VectorOfArray to Array when the size of the last dimension of each Array varies? Please see the MWE below.

v = VectorOfArray([rand(3, 2), rand(3, 2)])
convert(Array, v) # perfect

v = VectorOfArray([rand(3, 2), rand(3, 4)])
convert(Array, v) # want cat(v..., dims = 2)

Thanks in advance for any suggestions.

(If relevant, my need comes from the fact that, in Flux.jl, the last dimension of an Array corresponds to the observation dimension, and I have a variable number of observations in each Array.)

@ChrisRackauckas
Copy link
Member

No, an array cannot be ragged sized.

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