Skip to content

Commit c131d15

Browse files
Added test for conv when types lead to direct backend
1 parent f1abd1b commit c131d15

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

test/conv.jl

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -725,6 +725,18 @@ end
725725
@test size(conv(x, w; stride = (1, 2), pad = (2, 3), dilation = (2, 2), flipped = true)) == (12, 7, 16, 10)
726726
end
727727

728+
# https://github.com/FluxML/NNlib.jl/pull/171
729+
@testset "conv_wrapper with groups - not equal types that trigger direct backend" begin
730+
x = rand(Float32, 10, 10, 3, 8)
731+
w = rand(Float64, 2, 2, 3, 4)
732+
g = 2
733+
@test size(conv(x, w); groups=g) == (9, 9, 16, 8)
734+
@test size(conv(x, w; stride = (2, 2), pad = (2, 2), groups=g)) == (7, 7, 16, 8)
735+
@test size(conv(x, w1; stride = (1, 2), pad = (2, 3), groups=g)) == (12, 7, 16, 8)
736+
@test size(conv(x, w; stride = (1, 2), pad = (2, 3), dilation = (2, 2), groups=g)) == (12, 7, 16, 8)
737+
@test size(conv(x, w; stride = (1, 2), pad = (2, 3), dilation = (2, 2), flipped = true, groups=g)) == (12, 7, 16, 8)
738+
end
739+
728740
@testset "depthwiseconv_wrapper" begin
729741
x = rand(10, 10, 3, 10)
730742
w = rand(2, 2, 3, 3)

0 commit comments

Comments
 (0)