Skip to content

Commit

Permalink
test muladd mixing numbers and zerotangents
Browse files Browse the repository at this point in the history
  • Loading branch information
oxinabox committed Nov 10, 2023
1 parent e05886a commit 47479f4
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions test/rulesets/Base/base.jl
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,17 @@
test_rrule(muladd, 10randn(), randn(), randn())
end

@testset "muladd ZeroTangent" begin
test_frule(muladd, 2.0, 3.0, ZeroTangent())
test_frule(muladd, 2.0, ZeroTangent(), 4.0)
test_frule(muladd, ZeroTangent(), 3.0, 4.0)

test_rrule(muladd, 2.0, 3.0, ZeroTangent())
test_rrule(muladd, 2.0, ZeroTangent(), 4.0)
test_rrule(muladd, ZeroTangent(), 3.0, 4.0)
end


@testset "fma" begin
test_frule(fma, 10randn(), randn(), randn())
test_rrule(fma, 10randn(), randn(), randn())
Expand Down

0 comments on commit 47479f4

Please sign in to comment.