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

Special-case Complex? #1

Closed
cossio opened this issue Jun 8, 2020 · 0 comments
Closed

Special-case Complex? #1

cossio opened this issue Jun 8, 2020 · 0 comments

Comments

@cossio
Copy link
Owner

cossio commented Jun 8, 2020

using ZygoteStructArrays, Zygote, StructArrays
gradient(randn(2), randn(2)) do X, Y
    S = StructArray(Complex.(X, Y))
    sum(S.re) + sum(S.im)
end

fails, but

using ZygoteStructArrays, Zygote, StructArrays
struct Point
  x::Float64; y::Float64
end
gradient(randn(2), randn(2)) do X, Y
    S = StructArray(Point.(X, Y))
    sum(S.x) + sum(S.y)
end

works fine. The issue is that sensitivities for Complex in Zygote are not NamedTuple, see

FluxML/Zygote.jl#680

@cossio cossio closed this as completed in 6601382 Jun 9, 2020
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