add broken test for #700

This commit is contained in:
Jan Weidner 2019-03-26 04:45:22 -07:00
parent e991228047
commit 27a9a7b9cf
1 changed files with 26 additions and 0 deletions

View File

@ -61,3 +61,29 @@ end
x_hat = ConvTranspose((3, 3), 1 => 1)(y)
@test size(x_hat) == size(x)
end
@testset "Conv with non quadratic window #700" begin
data = fill(0f0, 7,7,1,1)
data[4,4,1,1] = 1
l = Conv((3,3), 1=>1)
expected = fill(zero(eltype(l.weight)),5,5,1,1)
expected[2:end-1,2:end-1,1,1] = l.weight
@test expected == l(data)
l = Conv((3,1), 1=>1)
expected = fill(zero(eltype(l.weight)),5,7,1,1)
expected[2:end-1,4,1,1] = l.weight
@test_broken expected == l(data)
l = Conv((1,3), 1=>1)
expected = fill(zero(eltype(l.weight)),7,5,1,1)
expected[4,2:end-1,1,1] = l.weight
@test_broken expected == l(data)
@test_broken begin
# we test that the next expression does not throw
randn(Float32, 10,10,1,1) |> Conv((6,1), 1=>1, Flux.σ)
true
end
end