Skip to content

Commit a0ba9c1

Browse files
committed
define conversion to VecOfArrays
1 parent a21c12e commit a0ba9c1

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/auxiliary/vector_of_arrays.jl

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,9 @@ Base.size(v::VecOfArrays) = Base.size(v.arrays)
1717
Base.length(v::VecOfArrays) = Base.length(v.arrays)
1818
Base.eltype(v::VecOfArrays{T}) where {T} = T
1919
function Adapt.adapt_structure(to, v::VecOfArrays)
20-
return [Adapt.adapt(to, arr) for arr in v.arrays] |> VecOfArrays
20+
return VecOfArrays([Adapt.adapt(to, arr) for arr in v.arrays])
21+
end
22+
function Base.convert(::Type{<:VecOfArrays}, v::Vector{<:AbstractArray})
23+
VecOfArrays(v)
2124
end
2225
end # @muladd

0 commit comments

Comments
 (0)