Skip to content

Commit 7e19660

Browse files
committed
Added tests
1 parent f8fe29f commit 7e19660

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

test/conv.jl

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,19 @@ using NNlib: conv, crosscor, ∇conv_filter, ∇conv_data, ∇maxpool, maxpool,
33
@testset "conv2d" begin
44
x = reshape(Float64[1:20;], 5, 4, 1, 1)
55
w = reshape(Float64[1:4;], 2, 2, 1, 1)
6+
w1 = reshape(Float64[1:6;], 2, 3, 1, 1)
7+
w2 = reshape(Float64[1:6;], 3, 2, 1, 1)
8+
9+
@test dropdims(conv(x, w1), dims = (3,4)) == [
10+
95.0 200.0;
11+
116.0 221.0;
12+
137.0 242.0;
13+
158.0 263.0]
14+
15+
@test dropdims(conv(x, w2), dims = (3,4)) == [
16+
68.0 173.0 278.0;
17+
89.0 194.0 299.0;
18+
110.0 215.0 320.0]
619

720
@test dropdims(conv(x, w), dims = (3,4)) == [
821
29 79 129;

0 commit comments

Comments
 (0)