Skip to content

Commit

Permalink
Preserve the dimensions of ReverseDiff TrackedArray
Browse files Browse the repository at this point in the history
  • Loading branch information
avik-pal committed Mar 7, 2024
1 parent bbf06e2 commit fc353f8
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion Project.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name = "ArrayInterface"
uuid = "4fba245c-0d91-5ea0-9b3e-6abc04ee57a9"
version = "7.8.0"
version = "7.8.1"

[deps]
Adapt = "79e6a3ab-5dfb-504d-930d-738a2a938a0e"
Expand Down
4 changes: 2 additions & 2 deletions ext/ArrayInterfaceReverseDiffExt.jl
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@ ArrayInterface.can_setindex(::Type{<:ReverseDiff.TrackedArray}) = false
ArrayInterface.fast_scalar_indexing(::Type{<:ReverseDiff.TrackedArray}) = false
function ArrayInterface.aos_to_soa(x::AbstractArray{<:ReverseDiff.TrackedReal,N}) where {N}
if length(x) > 1
reduce(vcat,x)
return reshape(reduce(vcat,x), size(x))
else
reduce(vcat,[x[1],x[1]])[1:1]
return reduce(vcat,[x[1],x[1]])[1:1]
end
end

Expand Down

0 comments on commit fc353f8

Please sign in to comment.