Skip to content

Commit f0731dc

Browse files
committed
Revert "unrelated test fixes in passing"
This reverts commit 688af01.
1 parent 46e5e9c commit f0731dc

File tree

1 file changed

+5
-20
lines changed

1 file changed

+5
-20
lines changed

test/rulesets/Base/base.jl

Lines changed: 5 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -98,16 +98,11 @@
9898
@testset "($x) * ($y)" for
9999
x in test_points, y in test_points
100100

101-
# all complex if any complex, was a limitation of FiniteDifferences?
102-
xx, yy = Base.promote(x, y)
103-
test_frule(*, xx, yy)
104-
test_rrule(*, xx, yy)
101+
# ensure all complex if any complex for FiniteDifferences
102+
x, y = Base.promote(x, y)
105103

106-
# explicitly allow mixed types
107104
test_frule(*, x, y)
108105
test_rrule(*, x, y)
109-
rrule(*, x, y)[2](1)[2] isa typeof(x)
110-
rrule(*, x, y)[2](1)[3] isa typeof(y)
111106
end
112107
end
113108

@@ -141,17 +136,14 @@
141136
test_rrule(identity, Tuple(randn(T, 3)))
142137
end
143138

144-
@testset "one(::Number), zero(::Number)" for x in (-0.1, 6.4, 1.0+0.5im, -10.0+0im, 0.0+200im)
139+
@testset "Constants" for x in (-0.1, 6.4, 1.0+0.5im, -10.0+0im, 0.0+200im)
145140
test_scalar(one, x)
146141
test_scalar(zero, x)
147-
148-
rrule(one, x)[2](1) === (NoTangent(), zero(x))
149-
rrule(zero, x)[2](1) === (NoTangent(), zero(x))
150142
end
151143

152144
@testset "muladd(x::$T, y::$T, z::$T)" for T in (Float64, ComplexF64)
153-
test_frule(muladd, 10randn(T), randn(T), randn(T))
154-
test_rrule(muladd, 10randn(T), randn(T), randn(T))
145+
test_frule(muladd, 10randn(), randn(), randn())
146+
test_rrule(muladd, 10randn(), randn(), randn())
155147
end
156148

157149
@testset "fma" begin
@@ -171,13 +163,6 @@
171163
# to right
172164
test_frule(clamp, 4., 2., 3.)
173165
test_rrule(clamp, 4., 2., 3.)
174-
175-
# nonzero gradient at the boundaries
176-
@test frule((0,1,0,0), clamp, 2, 2, 3) == (2, 1)
177-
@test rrule(clamp, 2.0, 2, 3)[2](1)[2] == 1.0
178-
179-
@test frule((0,1,0,0), clamp, 3, 2, 3) == (3, 1)
180-
@test rrule(clamp, 3, 2, 3)[2](1)[2] == 1.0
181166
end
182167

183168
@testset "rounding" begin

0 commit comments

Comments
 (0)