JuliaDiff / JuliaDiff/ChainRulesCore.jl

Make ZeroTangent() == 0

Open
#607 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

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

Description

I feel like we can overload == for ZeroTangent()`
to do something like

==(::ZeroTangent, a) = iszero(a)

would also need to overload hash
since all things that are equal to zero in julia have the same hash, buit we can just call hash(0, h)

this would be useful for testhing some of the stuff i am working on to not AD things that don't appear in this function.

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 locating the ZeroTangent definition and any existing equality or hashing methods. Check how Julia represents zero-like values and add tests covering equality with zero and matching hashes; done means the proposed comparisons and hash behavior work without breaking existing ZeroTangent tests.

Written by the indexing model from the issue text.

Assessment

Tech stack
julia
Domain
backend
Issue type
Feature
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.