Usage of similar in e.g.:
https://github.com/JuliaDiff/ForwardDiff.jl/blob/909976d719fdbd5fec91a159c6e2d808c45a770f/src/jacobian.jl#L149
is broken because it returns an ArrayPartition with the wrong number of elements.
This breaks later calls to e.g. reshape (see SciML/SciMLSensitivity.jl#404).
The returned array has the same size as the source ArrayPartition, and not the expected number of elements described by the dims argument(s).
This affects these two definitions:
|
# ignore dims since array partitions are vectors |
|
Base.similar(A::ArrayPartition, dims::NTuple{N,Int}) where {N} = similar(A) |
|
# ignore dims since array partitions are vectors |
|
Base.similar(A::ArrayPartition, ::Type{T}, dims::NTuple{N,Int}) where {T,N} = similar(A, T) |
Usage of
similarin e.g.:https://github.com/JuliaDiff/ForwardDiff.jl/blob/909976d719fdbd5fec91a159c6e2d808c45a770f/src/jacobian.jl#L149
is broken because it returns an
ArrayPartitionwith the wrong number of elements.This breaks later calls to e.g.
reshape(see SciML/SciMLSensitivity.jl#404).The returned array has the same size as the source
ArrayPartition, and not the expected number of elements described by thedimsargument(s).This affects these two definitions:
RecursiveArrayTools.jl/src/array_partition.jl
Lines 22 to 23 in 734999e
RecursiveArrayTools.jl/src/array_partition.jl
Lines 31 to 32 in 734999e