JuliaDiff / JuliaDiff/ChainRules.jl

Rules for zip missing

Open
#507 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

missing rule
Dominant language
Julia
Stars
475
Forks
98
PR merge metrics
No merged PRs in 30d

Description

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.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by running the two Zygote.gradient examples in the issue and compare the failing zip(x, y) path with the working alternatives. Inspect the ChainRules handling for Base.Iterators.Zip; done means the failing example differentiates successfully without the missing-adjoint error and the behavior is covered by a regression check.

Written by the indexing model from the issue text.

Assessment

Tech stack
julia
Domain
machine-learning
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.