SciML / SciML/RecursiveArrayTools.jl
Convert VectorOfArray to Array when the size of the last dimension of each Array varies
Nobody has claimed this yet.
- Dominant language
- Julia
- Stars
- 233
- Forks
- 76
- Avg merge
- 2h 17m
- Merged PRs (30d)
- 9
Description
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.)
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reproducing the MWE with VectorOfArray and inspect the conversion entry point in RecursiveArrayTools.jl. The change is done when arrays with equal last dimensions retain current conversion behavior and arrays with varying last dimensions are concatenated along dims = 2, with tests covering both cases.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- julia
- Domain
- data
- Issue type
- Feature
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 42/100