Skip to content

Commit 48e9695

Browse files
committed
some more cleanup
1 parent fab3325 commit 48e9695

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

test/test_util.jl

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -33,16 +33,16 @@ function test_scalar(f, x; rtol=1e-9, atol=1e-9, fdm=_fdm, test_wirtinger=x isa
3333
)
3434
else
3535
# For complex arguments, also check if the wirtinger derivative is correct
36-
∂Re = fdm-> f(x + ϵ), 0.0)
37-
∂Im = fdm-> f(x + im*ϵ), 0.0)
36+
∂Re = fdm-> f(x + ϵ), 0)
37+
∂Im = fdm-> f(x + im*ϵ), 0)
3838
= 0.5(∂Re - im*∂Im)
3939
∂̅ = 0.5(∂Re + im*∂Im)
4040
@test isapprox(
4141
wirtinger_primal(∂x(1)), ∂;
4242
rtol=rtol, atol=atol, kwargs...
4343
)
4444
@test isapprox(
45-
extern(wirtinger_conjugate(∂x(1))), ∂̅;
45+
wirtinger_conjugate(∂x(1)), ∂̅;
4646
rtol=rtol, atol=atol, kwargs...
4747
)
4848
end
@@ -162,7 +162,7 @@ end
162162
function Base.isapprox(d_ad::DNE, d_fd; kwargs...)
163163
error("Tried to differentiate w.r.t. a DNE")
164164
end
165-
function Base.isapprox(d_ad::Thunk, d_fd; kwargs...)
165+
function Base.isapprox(d_ad::Union{Thunk,One,Zero}, d_fd; kwargs...)
166166
return isapprox(extern(d_ad), d_fd; kwargs...)
167167
end
168168

0 commit comments

Comments
 (0)