From 00226351f2e0fe43d45d142e71873c562e202f58 Mon Sep 17 00:00:00 2001 From: hejunchao Date: Tue, 29 Aug 2023 14:58:24 +0800 Subject: [PATCH] json --- tests/kernels/generated/generated_macro.h | 2 +- tests/kernels/test_bucket_pad.cpp | 2 +- tests/kernels/test_celu.cpp | 2 +- tests/kernels/test_clamp.cpp | 2 +- tests/kernels/test_conv2d.cpp | 64 +++++++++----- tests/kernels/test_conv2d.json | 10 +++ tests/kernels/test_conv2d_transpose.cpp | 87 +++++++++++-------- tests/kernels/test_conv2d_transpose.json | 12 ++- tests/kernels/test_elu.cpp | 2 +- tests/kernels/test_erf.cpp | 2 +- tests/kernels/test_gelu.cpp | 2 +- tests/kernels/test_get_item.cpp | 2 +- tests/kernels/test_hard_sigmoid.cpp | 2 +- tests/kernels/test_hard_swish.cpp | 2 +- tests/kernels/test_hardmax.cpp | 2 +- tests/kernels/test_instance_normalization.cpp | 30 ++++--- .../kernels/test_instance_normalization.json | 4 + tests/kernels/test_leaky_relu.cpp | 2 +- tests/kernels/test_prelu.cpp | 2 +- tests/kernels/test_relu.cpp | 2 +- tests/kernels/test_selu.cpp | 2 +- tests/kernels/test_sigmoid.cpp | 2 +- tests/kernels/test_size_of.cpp | 2 +- tests/kernels/test_slice.cpp | 2 +- tests/kernels/test_softplus.cpp | 2 +- tests/kernels/test_softsign.cpp | 2 +- tests/kernels/test_space_to_batch.cpp | 2 +- tests/kernels/test_swish.cpp | 2 +- tests/kernels/test_topK.cpp | 2 +- 29 files changed, 160 insertions(+), 93 deletions(-) create mode 100644 tests/kernels/test_conv2d.json create mode 100644 tests/kernels/test_instance_normalization.json diff --git a/tests/kernels/generated/generated_macro.h b/tests/kernels/generated/generated_macro.h index 09327b23e9..34adf2dd1c 100644 --- a/tests/kernels/generated/generated_macro.h +++ b/tests/kernels/generated/generated_macro.h @@ -30,7 +30,7 @@ .expect("create tensor failed"); \ INIT_TENSOR(a1, init_f1); \ } \ - void TearDown() override {} \ + void TearDown() override { CLEAR_SUBCASE() } \ \ protected: \ runtime_tensor a0; \ diff --git a/tests/kernels/test_bucket_pad.cpp b/tests/kernels/test_bucket_pad.cpp index 2f9f2a38de..593464918d 100644 --- a/tests/kernels/test_bucket_pad.cpp +++ b/tests/kernels/test_bucket_pad.cpp @@ -50,7 +50,7 @@ class BucketPadTest : public KernelTest, .expect("create tensor failed"); } - void TearDown() override {} + void TearDown() override { CLEAR_SUBCASE() } protected: runtime_tensor input; diff --git a/tests/kernels/test_celu.cpp b/tests/kernels/test_celu.cpp index 63f8c2ac5c..45a0cb72df 100644 --- a/tests/kernels/test_celu.cpp +++ b/tests/kernels/test_celu.cpp @@ -47,7 +47,7 @@ class CeluTest : public KernelTest, init_tensor_alpha(alpha); } - void TearDown() override {} + void TearDown() override { CLEAR_SUBCASE() } virtual void init_tensor_alpha(runtime::runtime_tensor &tensor) { auto dtype = tensor.datatype(); diff --git a/tests/kernels/test_clamp.cpp b/tests/kernels/test_clamp.cpp index 94807ce2f5..7e6cd78b04 100644 --- a/tests/kernels/test_clamp.cpp +++ b/tests/kernels/test_clamp.cpp @@ -49,7 +49,7 @@ class ClampTest : public KernelTest, max_value = value2; } - void TearDown() override {} + void TearDown() override { CLEAR_SUBCASE() } protected: runtime_tensor input; diff --git a/tests/kernels/test_conv2d.cpp b/tests/kernels/test_conv2d.cpp index 3d4cf62f78..e20ac27a4f 100644 --- a/tests/kernels/test_conv2d.cpp +++ b/tests/kernels/test_conv2d.cpp @@ -22,18 +22,26 @@ #include #include +#define TEST_CASE_NAME "test_conv2d" + using namespace nncase; using namespace nncase::runtime; using namespace ortki; class Conv2DTest : public KernelTest, - public ::testing::TestWithParam< - std::tuple> { + public ::testing::TestWithParam> { public: void SetUp() override { - auto &&[typecode, input_shape, weight_shape, bias_shape, value1, value2, - value3, value4] = GetParam(); + READY_SUBCASE() + + auto typecode = GetDataType("lhs_type"); + auto input_shape = GetShapeArray("lhs_shape"); + auto weight_shape = GetShapeArray("weight_shape"); + auto bias_shape = GetShapeArray("bias_shape"); + dilations_value = GetShapeArray("dilations_value"); + pad_value = GetShapeArray("pad_value"); + strides_value = GetShapeArray("strides_value"); + group_value = GetNumber("group_value"); input = hrt::create(typecode, input_shape, host_runtime_tensor::pool_cpu_only) @@ -49,14 +57,9 @@ class Conv2DTest : public KernelTest, host_runtime_tensor::pool_cpu_only) .expect("create tensor failed"); init_tensor(bais); - - dilations_value = value1; - pad_value = value2; - strides_value = value3; - group_value = value4; } - void TearDown() override {} + void TearDown() override { CLEAR_SUBCASE() } protected: runtime_tensor input; @@ -68,16 +71,8 @@ class Conv2DTest : public KernelTest, int64_t group_value; }; -INSTANTIATE_TEST_SUITE_P( - conv2d, Conv2DTest, - testing::Combine( - testing::Values(dt_float32), - testing::Values(dims_t{1, 4, 5, 5}, dims_t{1, 4, 16, 16}), - testing::Values(dims_t{8, 4, 3, 3}, dims_t{8, 4, 1, 1}), - testing::Values(dims_t{8}), testing::Values(dims_t{2, 2}, dims_t{1, 1}), - testing::Values(dims_t{1, 1, 1, 1} /*, dims_t{0, 0, 1, 0}*/), - testing::Values(dims_t{1, 1}, dims_t{2, 2}), - testing::Values(1 /*, 2*/))); // todo result error +INSTANTIATE_TEST_SUITE_P(conv2d, Conv2DTest, + testing::Combine(testing::Range(0, MAX_CASE_NUM))); TEST_P(Conv2DTest, conv2d) { auto input_ort = runtime_tensor_2_ort_tensor(input); @@ -181,6 +176,33 @@ TEST_P(Conv2DTest, conv2d) { } int main(int argc, char *argv[]) { + READY_TEST_CASE_GENERATE() + FOR_LOOP(lhs_type, i) + FOR_LOOP(lhs_shape, j) + FOR_LOOP(weight_shape, k) + FOR_LOOP(bias_shape, l) + FOR_LOOP(dilations_value, m) + FOR_LOOP(pad_value, n) + FOR_LOOP(strides_value, o) + FOR_LOOP(group_value, p) + SPLIT_ELEMENT(lhs_type, i) + SPLIT_ELEMENT(lhs_shape, j) + SPLIT_ELEMENT(weight_shape, k) + SPLIT_ELEMENT(bias_shape, l) + SPLIT_ELEMENT(dilations_value, m) + SPLIT_ELEMENT(pad_value, n) + SPLIT_ELEMENT(strides_value, o) + SPLIT_ELEMENT(group_value, p) + WRITE_SUB_CASE() + FOR_LOOP_END() + FOR_LOOP_END() + FOR_LOOP_END() + FOR_LOOP_END() + FOR_LOOP_END() + FOR_LOOP_END() + FOR_LOOP_END() + FOR_LOOP_END() + ::testing::InitGoogleTest(&argc, argv); return RUN_ALL_TESTS(); } \ No newline at end of file diff --git a/tests/kernels/test_conv2d.json b/tests/kernels/test_conv2d.json new file mode 100644 index 0000000000..ccba39b078 --- /dev/null +++ b/tests/kernels/test_conv2d.json @@ -0,0 +1,10 @@ +{ + "lhs_type":["dt_float32"], + "lhs_shape":[[1, 4, 5, 5], [1, 4, 16, 16]], + "weight_shape":[[8, 4, 3, 3], [8, 4, 1, 1]], + "bias_shape":[[8]], + "dilations_value":[[2, 2], [1, 1]], + "pad_value":[[1, 1, 1, 1]], + "strides_value":[[1, 1], [2, 2]], + "group_value":[1] +} \ No newline at end of file diff --git a/tests/kernels/test_conv2d_transpose.cpp b/tests/kernels/test_conv2d_transpose.cpp index 96e60a1d86..24331e757c 100644 --- a/tests/kernels/test_conv2d_transpose.cpp +++ b/tests/kernels/test_conv2d_transpose.cpp @@ -22,19 +22,28 @@ #include #include +#define TEST_CASE_NAME "test_conv2d_transpose" + using namespace nncase; using namespace nncase::runtime; using namespace ortki; -class Conv2DTransposeTest - : public KernelTest, - public ::testing::TestWithParam< - std::tuple> { +class Conv2DTransposeTest : public KernelTest, + public ::testing::TestWithParam> { public: void SetUp() override { - auto &&[typecode, input_shape, weight_shape, bias_shape, value1, value2, - value3, value4, value5, value6] = GetParam(); + READY_SUBCASE() + + auto typecode = GetDataType("lhs_type"); + auto input_shape = GetShapeArray("lhs_shape"); + auto weight_shape = GetShapeArray("weight_shape"); + auto bias_shape = GetShapeArray("bias_shape"); + dilations_value = GetShapeArray("dilations_value"); + pad_value = GetShapeArray("pad_value"); + strides_value = GetShapeArray("strides_value"); + group_value = GetNumber("group_value"); + output_padding_value = GetShapeArray("output_padding_value"); + output_shape_value = GetShapeArray("output_shape_value"); input = hrt::create(typecode, input_shape, host_runtime_tensor::pool_cpu_only) @@ -50,16 +59,9 @@ class Conv2DTransposeTest host_runtime_tensor::pool_cpu_only) .expect("create tensor failed"); init_tensor(bais); - - dilations_value = value1; - pad_value = value2; - strides_value = value3; - group_value = value4; - output_padding_value = value5; - output_shape_value = value6; } - void TearDown() override {} + void TearDown() override { CLEAR_SUBCASE() } protected: runtime_tensor input; @@ -73,16 +75,8 @@ class Conv2DTransposeTest int64_t group_value; }; -INSTANTIATE_TEST_SUITE_P( - conv2d_transpose, Conv2DTransposeTest, - testing::Combine( - testing::Values(dt_float32), testing::Values(dims_t{1, 1, 5, 5}), - testing::Values(dims_t{1, 2, 3, 3}), testing::Values(dims_t{2}), - testing::Values(/*dims_t{2, 2} ,*/ dims_t{1, 1}), - testing::Values(dims_t{1, 1, 1, 1} /*, dims_t{0, 0, 1, 0}*/), - testing::Values(dims_t{1, 1} /*, dims_t{2, 2}*/), - testing::Values(1 /*, 2*/), testing::Values(dims_t{0, 0}), - testing::Values(dims_t{1, 2, 5, 5}))); +INSTANTIATE_TEST_SUITE_P(conv2d_transpose, Conv2DTransposeTest, + testing::Combine(testing::Range(0, MAX_CASE_NUM))); TEST_P(Conv2DTransposeTest, conv2d_transpose) { auto input_ort = runtime_tensor_2_ort_tensor(input); @@ -210,17 +204,38 @@ TEST_P(Conv2DTransposeTest, conv2d_transpose) { } int main(int argc, char *argv[]) { - // READY_TEST_CASE_GENERATE() - // FOR_LOOP(lhs_shape, i) - // FOR_LOOP(lhs_type, j) - // FOR_LOOP(rhs_type, k) - // SPLIT_ELEMENT(lhs_shape, i) - // SPLIT_ELEMENT(lhs_type, j) - // SPLIT_ELEMENT(rhs_type, k) - // WRITE_SUB_CASE() - // FOR_LOOP_END() - // FOR_LOOP_END() - // FOR_LOOP_END() + READY_TEST_CASE_GENERATE() + FOR_LOOP(lhs_type, i) + FOR_LOOP(lhs_shape, j) + FOR_LOOP(weight_shape, k) + FOR_LOOP(bias_shape, l) + FOR_LOOP(dilations_value, m) + FOR_LOOP(pad_value, n) + FOR_LOOP(strides_value, o) + FOR_LOOP(group_value, p) + FOR_LOOP(output_padding_value, r) + FOR_LOOP(output_shape_value, s) + SPLIT_ELEMENT(lhs_type, i) + SPLIT_ELEMENT(lhs_shape, j) + SPLIT_ELEMENT(weight_shape, k) + SPLIT_ELEMENT(bias_shape, l) + SPLIT_ELEMENT(dilations_value, m) + SPLIT_ELEMENT(pad_value, n) + SPLIT_ELEMENT(strides_value, o) + SPLIT_ELEMENT(group_value, p) + SPLIT_ELEMENT(output_padding_value, r) + SPLIT_ELEMENT(output_shape_value, s) + WRITE_SUB_CASE() + FOR_LOOP_END() + FOR_LOOP_END() + FOR_LOOP_END() + FOR_LOOP_END() + FOR_LOOP_END() + FOR_LOOP_END() + FOR_LOOP_END() + FOR_LOOP_END() + FOR_LOOP_END() + FOR_LOOP_END() ::testing::InitGoogleTest(&argc, argv); return RUN_ALL_TESTS(); diff --git a/tests/kernels/test_conv2d_transpose.json b/tests/kernels/test_conv2d_transpose.json index 8ddf991217..89b32ebb48 100644 --- a/tests/kernels/test_conv2d_transpose.json +++ b/tests/kernels/test_conv2d_transpose.json @@ -1,4 +1,12 @@ { - "lhs_shape":[[1, 8, 24, 24], [1, 3, 3, 16], [2, 4, 8, 8], [8, 8], [1, 3, 16, 1], [1, 1], [16]], - "lhs_type":["dt_int32"] + "lhs_type":["dt_float32"], + "lhs_shape":[[1, 1, 5, 5]], + "weight_shape":[[1, 2, 3, 3]], + "bias_shape":[[2]], + "dilations_value":[[1, 1]], + "pad_value":[[1, 1, 1, 1]], + "strides_value":[[1, 1]], + "group_value":[1], + "output_padding_value":[[0, 0]], + "output_shape_value":[[1, 2, 5, 5]] } \ No newline at end of file diff --git a/tests/kernels/test_elu.cpp b/tests/kernels/test_elu.cpp index b7d51de804..0e3002509b 100644 --- a/tests/kernels/test_elu.cpp +++ b/tests/kernels/test_elu.cpp @@ -47,7 +47,7 @@ class EluTest : public KernelTest, init_tensor(alpha); } - void TearDown() override {} + void TearDown() override { CLEAR_SUBCASE() } protected: runtime_tensor input; diff --git a/tests/kernels/test_erf.cpp b/tests/kernels/test_erf.cpp index 2bf6f994e6..504f87cc87 100644 --- a/tests/kernels/test_erf.cpp +++ b/tests/kernels/test_erf.cpp @@ -43,7 +43,7 @@ class ErfTest : public KernelTest, init_tensor(input); } - void TearDown() override {} + void TearDown() override { CLEAR_SUBCASE() } protected: runtime_tensor input; diff --git a/tests/kernels/test_gelu.cpp b/tests/kernels/test_gelu.cpp index a3e0ee0594..04ee0f9216 100644 --- a/tests/kernels/test_gelu.cpp +++ b/tests/kernels/test_gelu.cpp @@ -47,7 +47,7 @@ class GeluTest : public KernelTest, init_tensor_alpha(alpha); } - void TearDown() override {} + void TearDown() override { CLEAR_SUBCASE() } virtual void init_tensor_alpha(runtime::runtime_tensor &tensor) { auto dtype = tensor.datatype(); diff --git a/tests/kernels/test_get_item.cpp b/tests/kernels/test_get_item.cpp index 6ad5403cf8..2bd4f08365 100644 --- a/tests/kernels/test_get_item.cpp +++ b/tests/kernels/test_get_item.cpp @@ -39,7 +39,7 @@ class GetItemTest init_tensor(input); } - void TearDown() override {} + void TearDown() override { CLEAR_SUBCASE() } protected: runtime_tensor input; diff --git a/tests/kernels/test_hard_sigmoid.cpp b/tests/kernels/test_hard_sigmoid.cpp index 1b96601fff..29827f1a05 100644 --- a/tests/kernels/test_hard_sigmoid.cpp +++ b/tests/kernels/test_hard_sigmoid.cpp @@ -48,7 +48,7 @@ class HardSigmoidTest : public KernelTest, gamma_value = value2; } - void TearDown() override {} + void TearDown() override { CLEAR_SUBCASE() } protected: runtime_tensor input; diff --git a/tests/kernels/test_hard_swish.cpp b/tests/kernels/test_hard_swish.cpp index 23c591bc4e..f629c16ad0 100644 --- a/tests/kernels/test_hard_swish.cpp +++ b/tests/kernels/test_hard_swish.cpp @@ -42,7 +42,7 @@ class HardSwishTest : public KernelTest, .expect("create tensor failed"); } - void TearDown() override {} + void TearDown() override { CLEAR_SUBCASE() } protected: runtime_tensor input; diff --git a/tests/kernels/test_hardmax.cpp b/tests/kernels/test_hardmax.cpp index b8190f8499..5df077694b 100644 --- a/tests/kernels/test_hardmax.cpp +++ b/tests/kernels/test_hardmax.cpp @@ -48,7 +48,7 @@ class HardmaxTest : public KernelTest, : 0; } - void TearDown() override {} + void TearDown() override { CLEAR_SUBCASE() } protected: runtime_tensor input; diff --git a/tests/kernels/test_instance_normalization.cpp b/tests/kernels/test_instance_normalization.cpp index 0f0d6efaaa..d4fb672f8a 100644 --- a/tests/kernels/test_instance_normalization.cpp +++ b/tests/kernels/test_instance_normalization.cpp @@ -22,16 +22,21 @@ #include #include +#define TEST_CASE_NAME "test_instance_normalization" + using namespace nncase; using namespace nncase::runtime; using namespace ortki; class InstanceNormalizationTest : public KernelTest, - public ::testing::TestWithParam> { + public ::testing::TestWithParam> { public: void SetUp() override { - auto &&[typecode, l_shape] = GetParam(); + READY_SUBCASE() + + auto l_shape = GetShapeArray("lhs_shape"); + auto typecode = GetDataType("lhs_type"); input = hrt::create(typecode, l_shape, host_runtime_tensor::pool_cpu_only) @@ -49,7 +54,7 @@ class InstanceNormalizationTest init_tensor(b); } - void TearDown() override {} + void TearDown() override { CLEAR_SUBCASE() } protected: runtime_tensor input; @@ -57,14 +62,8 @@ class InstanceNormalizationTest runtime_tensor b; }; -INSTANTIATE_TEST_SUITE_P( - instance_normalization, InstanceNormalizationTest, - testing::Combine(testing::Values(dt_float32), - testing::Values(dims_t{3, 3, 16, 16}, dims_t{64, 2, 4, 8}, - dims_t{1, 2, 4, 8}, - dims_t{24, 3, - 16} /*, dims_t{24, 16, 16}*/))); -// todo when in_shape[0] is not 1,cos is about 0.96 +INSTANTIATE_TEST_SUITE_P(instance_normalization, InstanceNormalizationTest, + testing::Combine(testing::Range(0, MAX_CASE_NUM))); TEST_P(InstanceNormalizationTest, instance_normalization) { auto l_ort = runtime_tensor_2_ort_tensor(input); @@ -110,6 +109,15 @@ TEST_P(InstanceNormalizationTest, instance_normalization) { } int main(int argc, char *argv[]) { + READY_TEST_CASE_GENERATE() + FOR_LOOP(lhs_shape, i) + FOR_LOOP(lhs_type, j) + SPLIT_ELEMENT(lhs_shape, i) + SPLIT_ELEMENT(lhs_type, j) + WRITE_SUB_CASE() + FOR_LOOP_END() + FOR_LOOP_END() + ::testing::InitGoogleTest(&argc, argv); return RUN_ALL_TESTS(); } \ No newline at end of file diff --git a/tests/kernels/test_instance_normalization.json b/tests/kernels/test_instance_normalization.json new file mode 100644 index 0000000000..e8478a0f2d --- /dev/null +++ b/tests/kernels/test_instance_normalization.json @@ -0,0 +1,4 @@ +{ + "lhs_shape":[[3, 3, 16, 16], [64, 2, 4, 8], [1, 2, 4, 8], [24, 16, 16], [24, 3, 16]], + "lhs_type":["dt_float32"], +} \ No newline at end of file diff --git a/tests/kernels/test_leaky_relu.cpp b/tests/kernels/test_leaky_relu.cpp index 035263d2a5..cb2a8c23e7 100644 --- a/tests/kernels/test_leaky_relu.cpp +++ b/tests/kernels/test_leaky_relu.cpp @@ -47,7 +47,7 @@ class LeakyReluTest : public KernelTest, init_tensor(alpha); } - void TearDown() override {} + void TearDown() override { CLEAR_SUBCASE() } protected: runtime_tensor input; diff --git a/tests/kernels/test_prelu.cpp b/tests/kernels/test_prelu.cpp index b5d1df3ef4..9d86f69107 100644 --- a/tests/kernels/test_prelu.cpp +++ b/tests/kernels/test_prelu.cpp @@ -52,7 +52,7 @@ class PreluTest : public KernelTest, } } - void TearDown() override {} + void TearDown() override { CLEAR_SUBCASE() } slope_t GetSlopeArray(const char *key) { assert(_document[key].IsArray()); diff --git a/tests/kernels/test_relu.cpp b/tests/kernels/test_relu.cpp index 90e8c2bfc1..d2c7d2906d 100644 --- a/tests/kernels/test_relu.cpp +++ b/tests/kernels/test_relu.cpp @@ -43,7 +43,7 @@ class ReluTest : public KernelTest, init_tensor(input); } - void TearDown() override {} + void TearDown() override { CLEAR_SUBCASE() } protected: runtime_tensor input; diff --git a/tests/kernels/test_selu.cpp b/tests/kernels/test_selu.cpp index 76abef35d6..fe8ba873e5 100644 --- a/tests/kernels/test_selu.cpp +++ b/tests/kernels/test_selu.cpp @@ -48,7 +48,7 @@ class SeluTest : public KernelTest, gamma_value = value2; } - void TearDown() override {} + void TearDown() override { CLEAR_SUBCASE() } protected: runtime_tensor input; diff --git a/tests/kernels/test_sigmoid.cpp b/tests/kernels/test_sigmoid.cpp index c9d5b1180d..a6b2399465 100644 --- a/tests/kernels/test_sigmoid.cpp +++ b/tests/kernels/test_sigmoid.cpp @@ -43,7 +43,7 @@ class SigmoidTest : public KernelTest, init_tensor(input); } - void TearDown() override {} + void TearDown() override { CLEAR_SUBCASE() } protected: runtime_tensor input; diff --git a/tests/kernels/test_size_of.cpp b/tests/kernels/test_size_of.cpp index 3f81183f63..2c27ce0df0 100644 --- a/tests/kernels/test_size_of.cpp +++ b/tests/kernels/test_size_of.cpp @@ -44,7 +44,7 @@ class SizeOfTest : public KernelTest, init_tensor(input); } - void TearDown() override {} + void TearDown() override { CLEAR_SUBCASE() } protected: runtime_tensor input; diff --git a/tests/kernels/test_slice.cpp b/tests/kernels/test_slice.cpp index 62723b84ad..c97a1e27b0 100644 --- a/tests/kernels/test_slice.cpp +++ b/tests/kernels/test_slice.cpp @@ -91,7 +91,7 @@ class SliceTest : public KernelTest, .expect("create4 tensor failed"); } - void TearDown() override {} + void TearDown() override { CLEAR_SUBCASE() } protected: runtime_tensor input; diff --git a/tests/kernels/test_softplus.cpp b/tests/kernels/test_softplus.cpp index 5b2bd8b06b..f1257a3cf2 100644 --- a/tests/kernels/test_softplus.cpp +++ b/tests/kernels/test_softplus.cpp @@ -43,7 +43,7 @@ class SoftplusTest : public KernelTest, init_tensor(input); } - void TearDown() override {} + void TearDown() override { CLEAR_SUBCASE() } protected: runtime_tensor input; diff --git a/tests/kernels/test_softsign.cpp b/tests/kernels/test_softsign.cpp index 6ab4ee32ca..1e4d76809b 100644 --- a/tests/kernels/test_softsign.cpp +++ b/tests/kernels/test_softsign.cpp @@ -43,7 +43,7 @@ class SoftsignTest : public KernelTest, init_tensor(input); } - void TearDown() override {} + void TearDown() override { CLEAR_SUBCASE() } protected: runtime_tensor input; diff --git a/tests/kernels/test_space_to_batch.cpp b/tests/kernels/test_space_to_batch.cpp index e195be82f1..072cb8d493 100644 --- a/tests/kernels/test_space_to_batch.cpp +++ b/tests/kernels/test_space_to_batch.cpp @@ -58,7 +58,7 @@ class SpaceToBatchTest : public KernelTest, } } - void TearDown() override {} + void TearDown() override { CLEAR_SUBCASE() } protected: runtime_tensor expected; diff --git a/tests/kernels/test_swish.cpp b/tests/kernels/test_swish.cpp index b8815527fe..870744ae3b 100644 --- a/tests/kernels/test_swish.cpp +++ b/tests/kernels/test_swish.cpp @@ -43,7 +43,7 @@ class SwishTest : public KernelTest, init_tensor(input); } - void TearDown() override {} + void TearDown() override { CLEAR_SUBCASE() } protected: runtime_tensor input; diff --git a/tests/kernels/test_topK.cpp b/tests/kernels/test_topK.cpp index ecf0ed9ff5..7307abff03 100644 --- a/tests/kernels/test_topK.cpp +++ b/tests/kernels/test_topK.cpp @@ -75,7 +75,7 @@ class TopKTest : public KernelTest, k_value = value4; } - void TearDown() override {} + void TearDown() override { CLEAR_SUBCASE() } protected: runtime_tensor input;