jonniedie / ComponentArrays.jl

Arrays with arbitrarily nested named components.
MIT License
287 stars 34 forks source link

`similar` for GPU ComponentArrays #179

Closed avik-pal closed 1 year ago

avik-pal commented 1 year ago

When similar(::ComponentArray, l::Int) is used the resultant array is not a GPU array which breaks SciMLSensitivity + Lux on GPU. A patch is:

Base.similar(ca::ComponentArray, l::Int64) = similar(getdata(ca), l)