Skip to content

Replace with Flatten.jl #32

@maleadt

Description

@maleadt

Turns out Flatten.jl has something similar: Flatten.modify(CuArray, obj, Array). Doesn't use rules, instead eagerly tries to reconstruct objects by calling constructure. That doesn't always work of course:

julia> Flatten.modify(CuArray, view(rand(2,2),:,:), Array)
ERROR: MethodError: no method matching SubArray(::CuArray{Float64,2}, ::Tuple{Base.Slice{Base.OneTo{Int64}},Base.Slice{Base.OneTo{Int64}}}, ::Int64, ::Int64)

Furthermore, we currently need the WrappedArray dispatch rules, but once we have Base.AbstractWrappedArray (JuliaLang/julia#31563) we should investigate using this.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions