Skip to content

Commit 1b026c5

Browse files
committed
add debug mode
1 parent 367fd35 commit 1b026c5

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

test/runtests.jl

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@ using StableRNGs
66
using StaticArrays
77
using Test
88

9+
ChainRulesCore.debug_mode() = true
10+
911
rng = StableRNG(122)
1012

1113
function test_model_interface(K)
@@ -95,13 +97,14 @@ end
9597
@test Normal(fwhm=10) === Gaussian(fwhm=10)
9698

9799
@testset "gradients" begin
98-
psf_iso = Gaussian(fwhm=10)
100+
# have to make sure PSFs are all floating point so tangents don't have type issues
101+
psf_iso = Gaussian(fwhm=10.0, pos=zeros(2))
99102
psf_tang = Tangent{Gaussian}(fwhm=rand(rng), pos=rand(rng, 2), amp=rand(rng), indices=ZeroTangent())
100-
point = [1, 2]
103+
point = Float64[1, 2]
101104
test_frule(psf_iso psf_tang, point)
102105
test_rrule(psf_iso psf_tang, point)
103106

104-
psf_diag = Gaussian(fwhm=[10, 8])
107+
psf_diag = Gaussian(fwhm=Float64[10, 8], pos=zeros(2))
105108
psf_tang = Tangent{Gaussian}(fwhm=rand(rng, 2), pos=rand(rng, 2), amp=rand(rng), indices=ZeroTangent())
106109
test_frule(psf_diag psf_tang, point)
107110
test_rrule(psf_diag psf_tang, point)

0 commit comments

Comments
 (0)