You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The following snippet works well on CPU i.e., it gives the correct gradient but fails on GPU.
using Zygote
y=complex.([4,1])
x=complex.([3,2])
functionf1215(x, y)
x =2.* x
returnsum(abs2.(x .- y))
end
gs =gradient(()->f1215(x,y), Zygote.Params([x]))
gs[x] # returns nothing when x and y are on GPUusing CUDA
x =cu(x)
y =cu(y)
[Edited not to need Flux]
The text was updated successfully, but these errors were encountered:
pawbz
changed the title
Cannot compute gradients when using FFTW
Issue with complex AD when using CUDA
Apr 29, 2022
The gradient of broadcasting used for CuArrays doesn't handle complex numbers. It's a bit of a nasty surprise but nobody has got around to making it at least an error, or better to making it work.
The following snippet works well on CPU i.e., it gives the correct gradient but fails on GPU.
[Edited not to need Flux]
The text was updated successfully, but these errors were encountered: