Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Replace with Flatten.jl #32

Open
maleadt opened this issue Nov 12, 2020 · 0 comments
Open

Replace with Flatten.jl #32

maleadt opened this issue Nov 12, 2020 · 0 comments

Comments

@maleadt
Copy link
Member

maleadt commented Nov 12, 2020

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant