@@ -274,9 +274,13 @@ conv_answer_dict = Dict(
274274 # A "drop channels and batch dimension" helper
275275 ddims (x) = dropdims (x, dims= (rank+ 1 , rank+ 2 ))
276276
277- for conv in (NNlib. conv, NNlib. conv_im2col, NNlib. conv_direct, NNlib. conv_nnpack)
278- if conv == NNlib. conv_nnpack && ! NNlib. nnpack_supported_operation (DenseConvDims (x, w))
279- continue
277+ convs = [NNlib. conv, NNlib. conv_im2col, NNlib. conv_direct,]
278+ NNlib. is_nnpack_available () && push! (convs, NNlib. conv_nnpack)
279+ for conv in convs
280+ if NNlib. is_nnpack_available ()
281+ if conv == NNlib. conv_nnpack && ! NNlib. nnpack_supported_operation (DenseConvDims (x, w))
282+ continue
283+ end
280284 end
281285 @testset " $(conv) " begin
282286 cdims = DenseConvDims (x, w)
@@ -352,12 +356,11 @@ conv_answer_dict = Dict(
352356 end
353357 end
354358 end
359+ end
355360
361+ if get (ENV ," NNLIB_TEST_FUZZING" ," false" ) == " true"
362+ # @info("Skipping Convolutional fuzzing tests, set NNLIB_TEST_FUZZING=true to run them")
356363 @testset " fuzzing" begin
357- if get (ENV ," NNLIB_TEST_FUZZING" ," false" ) != " true"
358- @info (" Skipping Convolutional fuzzing tests, set NNLIB_TEST_FUZZING=true to run them" )
359- return
360- end
361364 @info (" Starting Convolutional fuzzing tests; this can take a few minutes..." )
362365 # Now that we're fairly certain things are working, let's fuzz things a little bit:
363366 for x_size in (
@@ -441,9 +444,10 @@ conv_answer_dict = Dict(
441444 end
442445 println ()
443446 end
447+ else
448+ @info " Skipping Convolutional fuzzing tests, set NNLIB_TEST_FUZZING=true to run them"
444449end
445450
446-
447451@testset " Depthwise Convolution" begin
448452 # Start with some easy-to-debug cases that we have worked through and _know_ work
449453 for rank in (1 ,) # 2,3)
@@ -552,12 +556,11 @@ end
552556 end
553557 end
554558 end
559+ end
560+
555561
562+ if get (ENV ," NNLIB_TEST_FUZZING" ," false" ) == " true"
556563 @testset " fuzzing" begin
557- if get (ENV ," NNLIB_TEST_FUZZING" ," false" ) != " true"
558- @info (" Skipping Depthwise Convolutional fuzzing tests, set NNLIB_TEST_FUZZING=true to run them" )
559- return
560- end
561564 @info (" Starting Depthwise Convolutional fuzzing tests; this can take a few minutes..." )
562565 # Now that we're fairly certain things are working, let's fuzz things a little bit:
563566 for x_size in (
641644 end
642645 println ()
643646 end
647+ else
648+ @info " Skipping Depthwise Convolutional fuzzing tests, set NNLIB_TEST_FUZZING=true to run them"
644649end
645650
651+
646652@testset " conv_wrapper" begin
647653 x = rand (10 , 10 , 3 , 10 )
648654 w = rand (2 , 2 , 3 , 16 )
0 commit comments