Skip to content

Commit

Permalink
Don't check inference on v1.6
Browse files Browse the repository at this point in the history
  • Loading branch information
BioTurboNick committed Sep 17, 2024
1 parent 01a9fba commit 1424ccd
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions test/rulesets/Base/indexing.jl
Original file line number Diff line number Diff line change
Expand Up @@ -217,10 +217,11 @@ end
# DimensionMismatch("second dimension of A, 6, does not match length of x, 5")
# Probably similar to https://github.com/JuliaDiff/ChainRulesTestUtils.jl/issues/234 (about Broadcasted not Generator)

test_rrule(collect eachrow, rand(5))
test_rrule(collect eachrow, rand(3, 4))
# Inference on 1.6 sometimes fails, so don't enforce there.
test_rrule(collect eachrow, rand(5); check_inferred=(VERSION >= v"1.7"))
test_rrule(collect eachrow, rand(3, 4); check_inferred=(VERSION >= v"1.7"))

test_rrule(collect eachcol, rand(3, 4))
test_rrule(collect eachcol, rand(3, 4); check_inferred=(VERSION >= v"1.7"))
@test_skip test_rrule(collect eachcol, Diagonal(rand(5))) # works locally!

if VERSION >= v"1.7"
Expand Down Expand Up @@ -253,5 +254,5 @@ end
# Second derivative rule
test_rrule(ChainRules.∇eachslice, [rand(4) for _ in 1:3], rand(3, 4), Val(1))
test_rrule(ChainRules.∇eachslice, [rand(3) for _ in 1:4], rand(3, 4), Val(2))
test_rrule(ChainRules.∇eachslice, [rand(2, 3) for _ in 1:4], rand(2, 3, 4), Val(3), check_inferred=false)
test_rrule(ChainRules.∇eachslice, [rand(2, 3) for _ in 1:4], rand(2, 3, 4), Val(3); check_inferred=(VERSION >= v"1.7"))
end

0 comments on commit 1424ccd

Please sign in to comment.