Skip to content

Commit 408ee52

Browse files
authored
Merge pull request #2167 from FluxML/bc/rm-array-cuarray-piracy
Remove piratical array conversion rule
2 parents 7997174 + 8bd0f02 commit 408ee52

File tree

1 file changed

+0
-5
lines changed

1 file changed

+0
-5
lines changed

src/functor.jl

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -121,11 +121,6 @@ adapt_storage(to::FluxCPUAdaptor, x::AbstractSparseArray) = x
121121
adapt_storage(to::FluxCPUAdaptor, x::CUDA.RNG) = Random.default_rng()
122122
adapt_storage(to::FluxCPUAdaptor, x::AbstractRNG) = x
123123

124-
# PIRACY, should be defined in CUDA.jl
125-
function ChainRulesCore.rrule(::Type{Array}, x::CUDA.CuArray)
126-
Array(x), dx -> (NoTangent(), CUDA.cu(unthunk(dx)))
127-
end
128-
129124
function ChainRulesCore.rrule(::typeof(Adapt.adapt_storage), to::FluxCPUAdaptor, x::CUDA.AbstractGPUArray)
130125
adapt_storage(to, x), dx -> (NoTangent(), NoTangent(), adapt_storage(FluxCUDAAdaptor(), unthunk(dx)))
131126
end

0 commit comments

Comments
 (0)