JuliaDiff / JuliaDiff/ChainRulesCore.jl

Teach Tangent{T} about NoTangent vs ZeroTangent?

Open
#481 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

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

Description

Right now canonicalizing at Tangent{T} inserts ZeroTangent for all fields of the T that don't have explict tangents recorded.
As does getproperty.
This is correct in that they don't have anything recorded as they don't get used to determine the output -- which is what ZeroTangent represents.
But it is also true for if the primal field is Char or Bool or Int or Symbol etc that they don't have a tangent space at all so NoTangent is also correct, and kinda more expected.

We can't always get it right just from the primal type, since it could be a indicator float etc.
But we can probably do pretty well

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 reading canonicalizing at Tangent{T} and the related getproperty behavior. Determine how to distinguish fields such as Char, Bool, Int, and Symbol, while preserving cases where the primal type may still have a tangent space; done means both paths return the appropriate NoTangent or ZeroTangent representation.

Written by the indexing model from the issue text.

Assessment

Tech stack
julia
Domain
tooling
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.