-
-
Notifications
You must be signed in to change notification settings - Fork 217
Open
Labels
CUDAAll things GPUAll things GPUChainRulesadjoint -> rrule, and further integrationadjoint -> rrule, and further integration
Description
Hi there,
I found an inconsistent behaviour when differentiating a function which takes in an AbstractCuSparseArray
versus the same function differentiating an AbstractSparseArray
using CUDA
using Zygote
using SparseArrays
logpos(a) = a > 0 ? log(a) : zero(a)
l(A) = sum(logpos.(A))
A = sprandn(Float32, 10,10,0.4)
dA = gradient(l, A)[1] # returns a sparse array, as expected
Acu = sparse(CuArray(A))
dAcu = gradient(l, Acu)[1] # returns a dense CuArray
Maybe someone here has an idea of where could this come from?
Metadata
Metadata
Assignees
Labels
CUDAAll things GPUAll things GPUChainRulesadjoint -> rrule, and further integrationadjoint -> rrule, and further integration