Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

Check for repeated unthunking

オープン
#262 コメント 0 件 リアクション 1 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

評価

難易度
5/5
見積もり時間
1週間以上
初心者へのやさしさ
30/100
issue の種類
機能追加
明瞭さ
説明が足りない
活発さ
停滞
技術スタック
julia
領域
testing

調査の方向性

報告された 193 行目付近の失敗について testers.jl の test_rrule から始め、繰り返し unthunking する場合の挙動について ChainRules.jl の pull request 670 を確認してください。複数回 unthunked される thunk と、同じ thunk が複数箇所で返される場合に期待される処理を定義し、その後、選択した挙動を示す回帰テストのカバレッジを追加してください。

索引モデルが issue の本文から書いたものです。

説明

enhancement

test_rrule checks that the rule accepts thunks.

Should it also check that these aren't accidentally un-thunked more than once, by some passing in some @thunk (COUNT[+=1]; val) thing? That's a mistake although not a wrong-answers one, just slow. As seen in https://github.com/JuliaDiff/ChainRules.jl/pull/670

julia> using ChainRulesCore, ChainRulesTestUtils

julia> plus(x,y) = x+y;

julia> unplus(z) = (NoTangent(), z, z);

julia> unplus(::AbstractThunk) = error("fails");

julia> ChainRulesCore.rrule(::typeof(plus), x, y) = x+y, unplus;

julia> test_rrule(plus, [1.0], [2.0])
test_rrule: plus on Vector{Float64},Vector{Float64}: Error During Test at /Users/me/.julia/packages/ChainRulesTestUtils/YbVdW/src/testers.jl:193
  Got exception outside of a @test
  fails

julia> unplus(z::AbstractThunk) = (NoTangent(), unthunk(@show z), @show unthunk(z))

julia> test_rrule(plus, [1.0], [2.0]);
z = Thunk(ChainRulesTestUtils.var"#61#65"{Vector{Float64}}([1.73]))
unthunk(z) = [1.73]
z = Thunk(ChainRulesTestUtils.var"#62#66"{Vector{Float64}}([1.73]))
unthunk(z) = [1.73]
Test Summary:                                       | Pass  Total  Time
test_rrule: plus on Vector{Float64},Vector{Float64} |    9      9  0.0s

Going further, should it also reject (or warn about) unplus(z::AbstractThunk) = (NoTangent(), z, z);? If what's returned contains exactly the same thunk it got, in more than one place, then it's likely that further steps will unthunk twice.

主要言語
Julia
スター
50
フォーク
18
PR マージ指標
30日以内にマージされた PR はありません

環境構築

このプロジェクトには開発コンテナ、Dockerfile、コントリビューションガイドがありません。まず README を読み、一般的な手順ははじめてのコントリビューションガイドを参照してください。

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

JuliaDiff/ChainRulesTestUtils.jl のほかの issue

JuliaDiff/ChainRulesTestUtils.jl の issue をすべて見る

似ている issue

Julia の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。