Skip to content

Commit b454024

Browse files
bors[bot]ToucheSir
andauthored
Merge #1650
1650: Use correct eltype and rtol in CrossCor tests r=darsnack a=ToucheSir Ref. #1649. ### PR Checklist - [x] Tests are added - [ ] ~~Entry in NEWS.md~~ - [ ] ~~Documentation, if applicable~~ - [ ] ~~API changes require approval from a committer (different from the author, if applicable)~~ Co-authored-by: Brian Chen <ToucheSir@users.noreply.github.com>
2 parents c99be6c + f2878c4 commit b454024

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

test/layers/conv.jl

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -115,10 +115,10 @@ end
115115

116116
@testset "CrossCor" begin
117117
x = rand(Float32, 28, 28, 1, 1)
118-
w = rand(2,2,1,1)
118+
w = rand(Float32, 2,2,1,1)
119119
y = CrossCor(w, [0.0])
120120

121-
@test isapprox(sum(w .* x[1:2, 1:2, :, :]), y(x)[1, 1, 1, 1], rtol=1e-7)
121+
@test sum(w .* x[1:2, 1:2, :, :]) y(x)[1, 1, 1, 1] rtol=1e-7
122122

123123
r = zeros(Float32, 28, 28, 1, 5)
124124
m = Chain(
@@ -131,7 +131,7 @@ end
131131

132132
@test size(m(r)) == (10, 5)
133133
@test y(x) != Conv(w, [0.0])(x)
134-
@test CrossCor(w[end:-1:1, end:-1:1, :, :], [0.0])(x) == Conv(w, [0.0])(x)
134+
@test CrossCor(w[end:-1:1, end:-1:1, :, :], [0.0])(x) Conv(w, [0.0])(x) rtol=1e-7
135135
end
136136

137137
@testset "Conv with non quadratic window #700" begin

0 commit comments

Comments
 (0)