diff options
Diffstat (limited to 'tests/dnn/dnn-layer-conv2d-test.c')
-rw-r--r-- | tests/dnn/dnn-layer-conv2d-test.c | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/tests/dnn/dnn-layer-conv2d-test.c b/tests/dnn/dnn-layer-conv2d-test.c index 836839cc64..378a05eafc 100644 --- a/tests/dnn/dnn-layer-conv2d-test.c +++ b/tests/dnn/dnn-layer-conv2d-test.c @@ -25,6 +25,8 @@ #define EPSON 0.00001 +extern const AVClass dnn_native_class; + static int test_with_same_dilate(void) { // the input data and expected data are generated with below python code. @@ -96,6 +98,10 @@ static int test_with_same_dilate(void) }; float bias[2] = { -1.6574852, -0.72915393 }; + NativeContext ctx; + ctx.class = &dnn_native_class; + ctx.options.conv2d_threads = 1; + params.activation = TANH; params.has_bias = 1; params.biases = bias; @@ -114,7 +120,7 @@ static int test_with_same_dilate(void) operands[1].data = NULL; input_indexes[0] = 0; - dnn_execute_layer_conv2d(operands, input_indexes, 1, ¶ms, NULL); + dnn_execute_layer_conv2d(operands, input_indexes, 1, ¶ms, &ctx); output = operands[1].data; for (int i = 0; i < sizeof(expected_output) / sizeof(float); i++) { @@ -196,6 +202,10 @@ static int test_with_valid(void) }; float bias[2] = { -0.4773722, -0.19620377 }; + NativeContext ctx; + ctx.class = &dnn_native_class; + ctx.options.conv2d_threads = 1; + params.activation = TANH; params.has_bias = 1; params.biases = bias; @@ -214,7 +224,7 @@ static int test_with_valid(void) operands[1].data = NULL; input_indexes[0] = 0; - dnn_execute_layer_conv2d(operands, input_indexes, 1, ¶ms, NULL); + dnn_execute_layer_conv2d(operands, input_indexes, 1, ¶ms, &ctx); output = operands[1].data; for (int i = 0; i < sizeof(expected_output) / sizeof(float); i++) { |