Skip to content

Commit

Permalink
approx
Browse files Browse the repository at this point in the history
  • Loading branch information
mcabbott committed Feb 24, 2022
1 parent e395a21 commit bc4d45f
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions test/rulesets/Base/mapreduce.jl
Original file line number Diff line number Diff line change
Expand Up @@ -128,13 +128,13 @@ struct SumRuleConfig <: RuleConfig{Union{HasReverseMode}} end
@test y1 === 4.0
@test unthunk(bk1(10.0)[3]) == [-10, 0, 0, 0]

# dims keyword -- these need to call `rrule_via_ad(broadcast, ...`, which needs AD
# dims keyword -- these call `rrule_via_ad(broadcast, ...`
test_rrule(maximum, sqrt, Float64[1 2; 3 4], fkwargs=(; dims = 1), check_inferred=false)
test_rrule(minimum, abs, randn(3,3), fkwargs=(; dims = 2), check_inferred=false)

y2, bk2 = rrule(CFG, minimum, abs, [1 2 3; -5 -4 -4], dims = 2)
@test y2 == hcat([1, 4])
@test_broken unthunk(bk2(hcat([10, 20]))[3]) == [10 0 0; 0 -20 0]
@test unthunk(bk2(hcat([10, 20]))[3]) [10 0 0; 0 -20 0]
end

@testset "prod" begin
Expand Down

0 comments on commit bc4d45f

Please sign in to comment.