JuliaDiff / JuliaDiff/ChainRulesCore.jl

Is `add!!(::Diagonal, ::Array)` correct?

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

Nobody has claimed this yet.

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

Description

Right now we claim that Diagonal is a inplacable_destination if it is wrapping around a vector that is itself an inplacable_destination.
However, Diagonal is only inplacable if the other side is itself diagonal.
Which one might in general assume to be the case since differential types should in general have same structure as primal types.
but IIRC there are some operations that have dense primal, but diagonal differentials.
So if you have that operation and also another function on the same data with a dense differntial then this could happen

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

The issue names add!!(::Diagonal, ::Array) as the entry point; inspect its current inplacable_destination handling and related type rules. Compare cases where the other operand is diagonal or dense, then make the expected classification explicit and add coverage for the agreed behavior.

Written by the indexing model from the issue text.

Assessment

Tech stack
julia
Domain
backend-api-design
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.