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

Rules for zip missing #507

Open
AlexRobson opened this issue Aug 20, 2021 · 1 comment · May be fixed by #671
Open

Rules for zip missing #507

AlexRobson opened this issue Aug 20, 2021 · 1 comment · May be fixed by #671

Comments

@AlexRobson
Copy link
Member

AlexRobson commented Aug 20, 2021

Probably this generalises to others in Base.Iterators

Sometimes this works in Zygote and sometimes it doesn't - i haven't worked out what the difference is:

x, y = rand(3,), rand(3,)
Zygote.gradient(() -> sum(first(zip(x, y)))) # works
Zygote.gradient(() -> sum(map(_ -> 1.0, (x, y)))) # works
Zygote.gradient(() -> sum(map(_ -> 1.0, zip(x, y)))) # errors Need an adjoint for constructor Base.Iterators.Zip{Tuple{Vector{Float64}, Vector{Float64}}}

Anyway, it looks like zip is missing from CR.

@mcabbott
Copy link
Member

Xref an attempt to do this within Zygote: FluxML/Zygote.jl#785 Which always got stuck on yet more weird cases.

@mcabbott mcabbott linked a pull request Aug 30, 2022 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants