JuliaDiff / JuliaDiff/ChainRulesCore.jl

Composite clarification

Open
#221 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

design documentation Structural Tangent
Dominant language
Julia
Stars
267
Forks
66
PR merge metrics
No merged PRs in 30d

Description

The docs say that Composite users should disregard the T parameter as it is an implementation detail.

However both ChainRules and Zygote do not always follow this recommendation.

There is a difference between the two constructors and it is not clear when to apply which one. Perhaps a comment could be added to the docs?

julia> xt = (1, 2)
(1, 2)

julia> ct1 = Composite{Any, typeof(xt)}(xt)
Composite{Any}(1, 2)

julia> ct2 = Composite{Any}(xt)
Composite{Any}((1, 2),)

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 with the Composite section in the linked ChainRulesCore API documentation, then compare the two constructor examples with the usages in ChainRules' evalpoly.jl and Zygote's compiler/chainrules.jl. Done means the documentation clearly explains when each constructor form should be used and how the T parameter relates to that choice.

Written by the indexing model from the issue text.

Assessment

Tech stack
julia
Domain
documentation
Issue type
Documentation
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.