-
-
Notifications
You must be signed in to change notification settings - Fork 68
Closed
Description
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:
RecursiveArrayTools.jl/src/array_partition.jl
Lines 22 to 23 in 734999e
# ignore dims since array partitions are vectors | |
Base.similar(A::ArrayPartition, dims::NTuple{N,Int}) where {N} = similar(A) |
RecursiveArrayTools.jl/src/array_partition.jl
Lines 31 to 32 in 734999e
# ignore dims since array partitions are vectors | |
Base.similar(A::ArrayPartition, ::Type{T}, dims::NTuple{N,Int}) where {T,N} = similar(A, T) |
Metadata
Metadata
Assignees
Labels
No labels