Hacktoberfest 2026: những issue maintainer đã đánh dấu cho tháng Mười, đang mở và phù hợp người mới. Xem issue Hacktoberfest

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

Đang mở
#442 7 bình luận 0 reaction 0 người được giao Xem trên GitHub

Chưa có ai nhận issue này.

Đánh giá

Độ khó
5/5
Thời gian dự kiến
Hơn một tuần
Mức phù hợp với người mới
20/100
Loại issue
Lỗi
Độ rõ ràng
Cần làm rõ
Mức độ hoạt động
Đình trệ
Công nghệ
julia
Lĩnh vực
devtools

Hướng nghiên cứu

Bắt đầu với các lỗi được thu thập thông qua ChainRulesTestUtils PR 176 và kiểm tra các pullbacks bị ảnh hưởng của ChainRules.jl cùng cách xử lý ZeroTangent. Tái hiện các lỗi đã báo cáo, xác định trường hợp nào nên chiếu ZeroTangent thay vì hỗ trợ trực tiếp, và coi công việc hoàn tất khi các lỗi kiểm thử liên quan được giải quyết mà không phải đánh đổi về cấp phát ở mức không thể chấp nhận.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

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
Ngôn ngữ chính
Julia
Star
475
Fork
98
Merge trung bình
1 ngày 3 giờ
Pull request đã merge (30 ngày)
2

Chuẩn bị môi trường

Dự án này không cung cấp dev container, Dockerfile hay hướng dẫn đóng góp, nên bạn cần tự thiết lập môi trường: hãy bắt đầu từ README và xem hướng dẫn đóng góp lần đầu của chúng tôi để biết các bước chung.

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của JuliaDiff/ChainRules.jl

Tất cả issue của JuliaDiff/ChainRules.jl

Issue tương tự

Thêm issue về Julia

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.