JuliaDiff / JuliaDiff/ChainRulesTestUtils.jl

test_rrule bug?

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

Nobody has claimed this yet.

bug
Dominant language
Julia
Stars
50
Forks
18
PR merge metrics
No merged PRs in 30d

Description

From

https://github.com/JuliaDiff/ChainRules.jl/blob/24318b0321ccd48f16cbbd59dba6ae8bb9e90860/test/rulesets/LinearAlgebra/structured.jl#L120

using ChainRules
using ChainRulesCore
using ChainRulesTestUtils
using LinearAlgebra

f = adjoint
T = Float64
n = 5
m = 3

A = randn(T, n, m)
Y = f(A)
Ȳ_mat = randn(T, m, n)
Ȳ_composite = Composite{typeof(Y)}(parent=collect(f(Ȳ_mat)))

test_rrule(f, A; output_tangent=Ȳ_mat) # works
test_rrule(f, A; output_tangent=Ȳ_composite) # breaks
test_rrule(f, A) # breaks

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 with test/rulesets/LinearAlgebra/structured.jl at the referenced line and run the provided Julia reproduction using test_rrule with the three output-tangent cases. Compare the working matrix case with the failing Composite and omitted-tangent cases; done means the relevant tests pass consistently for all three cases.

Written by the indexing model from the issue text.

Assessment

Tech stack
julia
Domain
testing-qa
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.