Skip to content

Commit

Permalink
+ tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Michael Abbott committed Dec 27, 2020
1 parent bafa3ba commit df02563
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions test/rulesets/LinearAlgebra/norm.jl
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,9 @@
end
T == Float64 && ndims(x) == 1 && @testset "Integer input" begin
x = [1,2,3]
_, int_back = rrule(fnorm, x)
_, float_back = rrule(fnorm, float(x))
int_fwd, int_back = rrule(fnorm, x)
float_fwd, float_back = rrule(fnorm, float(x))
@test int_fwd float_fwd
@test unthunk(int_back(1.0)[2]) unthunk(float_back(1.0)[2])
end
end
Expand Down Expand Up @@ -135,8 +136,9 @@
@test rrule(fnorm, x, p)[2](Zero())[2] isa Zero
T == Float64 && sz == (3,) && @testset "Integer input, p=$p" begin
x = [1,2,3]
_, int_back = rrule(fnorm, x, p)
_, float_back = rrule(fnorm, float(x), p)
int_fwd, int_back = rrule(fnorm, x, p)
float_fwd, float_back = rrule(fnorm, float(x), p)
@test int_fwd float_fwd
@test unthunk(unthunk(int_back(1.0)[2])) unthunk(unthunk(float_back(1.0)[2]))
end
end
Expand Down

0 comments on commit df02563

Please sign in to comment.