Skip to content

Commit fc353f8

Browse files
committed
Preserve the dimensions of ReverseDiff TrackedArray
1 parent bbf06e2 commit fc353f8

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

Project.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
name = "ArrayInterface"
22
uuid = "4fba245c-0d91-5ea0-9b3e-6abc04ee57a9"
3-
version = "7.8.0"
3+
version = "7.8.1"
44

55
[deps]
66
Adapt = "79e6a3ab-5dfb-504d-930d-738a2a938a0e"

ext/ArrayInterfaceReverseDiffExt.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,9 @@ ArrayInterface.can_setindex(::Type{<:ReverseDiff.TrackedArray}) = false
1414
ArrayInterface.fast_scalar_indexing(::Type{<:ReverseDiff.TrackedArray}) = false
1515
function ArrayInterface.aos_to_soa(x::AbstractArray{<:ReverseDiff.TrackedReal,N}) where {N}
1616
if length(x) > 1
17-
reduce(vcat,x)
17+
return reshape(reduce(vcat,x), size(x))
1818
else
19-
reduce(vcat,[x[1],x[1]])[1:1]
19+
return reduce(vcat,[x[1],x[1]])[1:1]
2020
end
2121
end
2222

0 commit comments

Comments
 (0)