File tree Expand file tree Collapse file tree 1 file changed +6
-4
lines changed
test/rulesets/LinearAlgebra Expand file tree Collapse file tree 1 file changed +6
-4
lines changed Original file line number Diff line number Diff line change 55
55
end
56
56
T == Float64 && ndims (x) == 1 && @testset " Integer input" begin
57
57
x = [1 ,2 ,3 ]
58
- _, int_back = rrule (fnorm, x)
59
- _, float_back = rrule (fnorm, float (x))
58
+ int_fwd, int_back = rrule (fnorm, x)
59
+ float_fwd, float_back = rrule (fnorm, float (x))
60
+ @test int_fwd ≈ float_fwd
60
61
@test unthunk (int_back (1.0 )[2 ]) ≈ unthunk (float_back (1.0 )[2 ])
61
62
end
62
63
end
135
136
@test rrule (fnorm, x, p)[2 ](Zero ())[2 ] isa Zero
136
137
T == Float64 && sz == (3 ,) && @testset " Integer input, p=$p " begin
137
138
x = [1 ,2 ,3 ]
138
- _, int_back = rrule (fnorm, x, p)
139
- _, float_back = rrule (fnorm, float (x), p)
139
+ int_fwd, int_back = rrule (fnorm, x, p)
140
+ float_fwd, float_back = rrule (fnorm, float (x), p)
141
+ @test int_fwd ≈ float_fwd
140
142
@test unthunk (unthunk (int_back (1.0 )[2 ])) ≈ unthunk (unthunk (float_back (1.0 )[2 ]))
141
143
end
142
144
end
You can’t perform that action at this time.
0 commit comments