Hacktoberfest 2026: le issue che i maintainer hanno segnato per ottobre, aperte e adatte ai principianti. Sfoglia le issue Hacktoberfest

`f/rrules` should support receiving `ZeroTangent()`

Aperta
#442 7 commenti 0 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
5/5
Tempo stimato
Più di una settimana
Idoneità per principianti
20/100
Tipo di issue
Bug
Chiarezza
Da chiarire
Stato di attività
Ferma
Stack tecnologico
julia
Ambito
devtools

Direzione di ricerca

Inizia dai fallimenti raccolti tramite ChainRulesTestUtils PR 176 e ispeziona i pullbacks interessati di ChainRules.jl e la gestione di ZeroTangent. Riproduci gli errori segnalati, determina quali casi dovrebbero proiettare ZeroTangent invece di supportarlo direttamente e considera concluso il lavoro quando gli errori dei test pertinenti sono risolti senza compromessi inaccettabili sulle allocazioni.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

design needs-careful-thought

Similarly to https://github.com/JuliaDiff/ChainRules.jl/issues/408, ZeroTangent() is a valid input to the pullback, and we need to make sure it is supported.

Using https://github.com/JuliaDiff/ChainRulesTestUtils.jl/pull/176, there are at least three kinds of errors:

  1. Pullbacks are written such that they do not support taking in ZeroTangent(), e.g.
    MethodError: no method matching (::ChainRules.var"#transpose_pullback#1894")(::ZeroTangent). These just need to be fixed in ChainRules.jl
  2. Places where we (I think?) have to project the ZeroTangent():
    TypeError: in Hermitian, in S, expected S<:(AbstractArray{var"#s832", 2} where var"#s832"<:T), got Type{ZeroTangent}
    and
MethodError: Cannot `convert` an object of type 
    ZeroTangent to an object of type 
    Matrix{T} where T
  1. Errors which could be solved by projecting the ZeroTangent() e.g.
    MethodError: no method matching getindex(::ZeroTangent, ::Int64). The question is whether we actually want to project to an array, since that would allocate quite a bit. Alternatively, we could define Base.getindex(::ZeroTangent, args...) = ZeroTangent(). There might be quite a few of these functions to define, but it would be much faster.
    Some examples are:
  • MethodError: no method matching Complex(::ZeroTangent)
  • MethodError: no method matching mapfoldl(::typeof(identity), ::typeof(Base.add_sum), ::ZeroTangent; dims=Colon())
  • MethodError: no method matching tr(::ZeroTangent)
  • MethodError: no method matching mul!(::ZeroTangent, ::Matrix{Float64}, ::ZeroTangent, ::Bool, ::Bool)
  • MethodError: no method matching trsyl!(::Char, ::Char, ::Matrix{ComplexF64}, ::Matrix{ComplexF64}, ::ZeroTangent)
  • MethodError: no method matching size(::ZeroTangent, ::Int64)
  • MethodError: no method matching LowerTriangular(::ZeroTangent)
    and the list goes on

This is just a quick (incomplete) dump of observations and first thoughts. I may have missed kinds of errors, or said things which are untrue.

Alltogether:

Test Summary:     |  Pass  Error  Broken  Total
ChainRules          | 24330   429    4    24763
Lingua principale
Julia
Stelle
475
Fork
98
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

Preparare l'ambiente

Questo progetto non fornisce container di sviluppo, Dockerfile né guida per i contributori, quindi l'ambiente è a tuo carico: parti dal suo README e consulta la nostra guida al primo contributo per i passaggi generali.

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di JuliaDiff/ChainRules.jl

Tutte le issue di JuliaDiff/ChainRules.jl

Issue simili

Altre issue su Julia

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.