From 1146cbeda2bc58d37bf9cb6001f2ddcbe227da25 Mon Sep 17 00:00:00 2001 From: Christopher Rackauckas Date: Wed, 23 Apr 2025 08:06:26 -0400 Subject: [PATCH 1/2] Make VectorOfArray adapt not broadcast the `to` --- src/vector_of_array.jl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/vector_of_array.jl b/src/vector_of_array.jl index 3fa52087..29bc3143 100644 --- a/src/vector_of_array.jl +++ b/src/vector_of_array.jl @@ -143,11 +143,11 @@ end Base.convert(::Type{AbstractArray}, VA::AbstractVectorOfArray) = stack(VA.u) function Adapt.adapt_structure(to, VA::AbstractVectorOfArray) - VectorOfArray(Adapt.adapt.(to, VA.u)) + VectorOfArray(Adapt.adapt.((to,), VA.u)) end function Adapt.adapt_structure(to, VA::AbstractDiffEqArray) - DiffEqArray(Adapt.adapt.(to, VA.u), Adapt.adapt(to, VA.t)) + DiffEqArray(Adapt.adapt.((to,), VA.u), Adapt.adapt((to,), VA.t)) end function VectorOfArray(vec::AbstractVector{T}, ::NTuple{N}) where {T, N} From a2a0e41f8f5909dd265dc5d475324c7c0318c384 Mon Sep 17 00:00:00 2001 From: Christopher Rackauckas Date: Wed, 23 Apr 2025 08:18:41 -0400 Subject: [PATCH 2/2] Update src/vector_of_array.jl --- src/vector_of_array.jl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/vector_of_array.jl b/src/vector_of_array.jl index 29bc3143..7e38fb89 100644 --- a/src/vector_of_array.jl +++ b/src/vector_of_array.jl @@ -147,7 +147,7 @@ function Adapt.adapt_structure(to, VA::AbstractVectorOfArray) end function Adapt.adapt_structure(to, VA::AbstractDiffEqArray) - DiffEqArray(Adapt.adapt.((to,), VA.u), Adapt.adapt((to,), VA.t)) + DiffEqArray(Adapt.adapt.((to,), VA.u), Adapt.adapt(to, VA.t)) end function VectorOfArray(vec::AbstractVector{T}, ::NTuple{N}) where {T, N}