JuliaArrays / ArrayInterface.jl

Designs for new Base array interface primitives, used widely through scientific machine learning (SciML) and other organizations
https://docs.sciml.ai/ArrayInterface/stable/
MIT License
134 stars 37 forks source link

Handling wrapped arrays #47

Open ChrisRackauckas opened 4 years ago

ChrisRackauckas commented 4 years ago

Today I gave up on something...

    function DiffEqBase.get_tmp(dc::DiffEqBase.DiffCache, u::LabelledArrays.LArray{T,N,D,Syms}) where {T,N,D,Syms}
      x = reinterpret(T, dc.dual_du.__x)
      LArray{T,N,D,Syms}(x)
    end

we need a better way to handle things like reinterpret and reshape on array types that are actually just wrapping another array type.

Tokazama commented 4 years ago

I think in general we need better support for getting at wrapped parameters. For example, parent_type would be helpful for these sorts of methods because we don't know for sure that x will be of the type D.