Comments (7)
Yeah getting this stable is in scope. Thanks for bringing this up. I think this may have regressed with the v3.
from recursivearraytools.jl.
VectorOfArray([zeros(4), VectorOfArray([zeros(4,4)])])
this is a bit of a tough one. Technically it isn't a valid VoA since VectorOfArray
isn't an array. The eltype of this is Any
, so it infers `Any.
from recursivearraytools.jl.
I've fixed the eltype, but sum
/mapreduce
isn't going to be type-stable. sum(VectorOfArray([zeros(4), VectorOfArray([zeros(4,4)])]))
didn't even work in v2. I've made it work (in some cases) here, but don't think it'll ever be inferrable. As long as VectorOfArray
s don't contain both arrays and VectorOfArray
s, it will infer fine
from recursivearraytools.jl.
I see, makes sense. Thanks a lot!
from recursivearraytools.jl.
So there's a tradeoff. If mapreduce
is defined as reduce(op, (mapreduce(f, op, x) for x in A.x))
then sum(ArrayPartition(ArrayPartition(zeros(4,4))))
is not type-stable (infers Any
) but sum(ArrayPartition([1, 2], [3.0, 4.0]))
is (infers Float64
, and internally unrolls the loop). However, if it is defined as mapreduce(f, op, (x for x in A))
then the former is correctly inferred as Float64
but the latter infers Union{Int, Float64}
and doesn't unroll loops.
from recursivearraytools.jl.
Just check if the eltype of the tuple is ArrayPartition? That won't hit every case but it should hit "most"
from recursivearraytools.jl.
This was closed but was it solved? Is https://github.com/SciML/SciMLSensitivity.jl/actions/runs/7433580549/job/20226765424?pr=965 not related?
from recursivearraytools.jl.
Related Issues (20)
- Incorrect `iszero` behavior HOT 2
- Improve docstrings
- Prepending/appending a list of ArrayPartition HOT 1
- similar() of ArrayPartition involving primitives fails HOT 3
- `@deprecate` usage invalid on Julia <=1.7 HOT 8
- Implement `pointer` and `resize!` for `VectorOfArray`
- v3.2.0 precompiles fail with "Method definition overwritten" HOT 5
- Fix method ambiguities.
- views with `Vector{Bool}` indices are broken HOT 1
- 3.4.1 -> 3.4.2 breaking HOT 5
- Documentation does not reflect deprecation of linear indexing HOT 2
- Add `eachrow`/`eachcol`/`eachslice` for `AbstractVectorOfArray`
- `getindex` with slice breaks on size 1 arrays
- ArrayPartition Incompatible for Native Implicit SDE Solvers HOT 4
- Getting the `sol` of an observed variable (using SymbolicIndexingInterface) of a trivial ODE (with no reduced states) fails HOT 2
- Broadcast over `VectorOfArray` doesn't respect dimensions of non-vector parent arrays HOT 2
- Broadcasted assignment fails for `VectorOfArray(Array{<:SVector{1}})` HOT 1
- Behaviour of recursive_unitless_bottom_eltype on Vector{Real} HOT 10
- New release to support FastBroadcast 0.3 in the SciML ecosystem? HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from recursivearraytools.jl.