RecursiveArrayTools.jl
RecursiveArrayTools.jl copied to clipboard
Convert VectorOfArray to Array when the size of the last dimension of each Array varies
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.)
No, an array cannot be ragged sized.