Merge pull request #973 from FluxML/sf/nnpack_tolerance

Give `NNPACK` a bit of numerical leeway
This commit is contained in:
Dhairya Gandhi 2019-12-23 15:57:56 +05:30 committed by GitHub
commit e92da0cf85
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 4 deletions

View File

@ -66,7 +66,7 @@ end
w = rand(2,2,1,1)
y = CrossCor(w, [0.0])
@test sum(w .* x[1:2, 1:2, :, :]) == y(x)[1, 1, 1, 1]
@test isapprox(sum(w .* x[1:2, 1:2, :, :]), y(x)[1, 1, 1, 1], rtol=1e-7)
r = zeros(Float32, 28, 28, 1, 5)
m = Chain(
@ -89,17 +89,17 @@ end
l = Conv((3,3), 1=>1)
expected = zeros(eltype(l.weight),5,5,1,1)
expected[2:end-1,2:end-1,1,1] = l.weight
@test expected == l(data)
@test expected l(data)
l = Conv((3,1), 1=>1)
expected = zeros(eltype(l.weight),5,7,1,1)
expected[2:end-1,4,1,1] = l.weight
@test expected == l(data)
@test expected l(data)
l = Conv((1,3), 1=>1)
expected = zeros(eltype(l.weight),7,5,1,1)
expected[4,2:end-1,1,1] = l.weight
@test expected == l(data)
@test expected l(data)
@test begin
# we test that the next expression does not throw