From 2cd8e4d0faa12ba831942ff4e8f3e60f92050cf5 Mon Sep 17 00:00:00 2001 From: nihuini Date: Fri, 10 Jul 2020 19:59:00 +0800 Subject: [PATCH] fix floor ceil test with very small numbers --- tests/test_unaryop.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/tests/test_unaryop.cpp b/tests/test_unaryop.cpp index b56fe5a08..6d4a0cae1 100644 --- a/tests/test_unaryop.cpp +++ b/tests/test_unaryop.cpp @@ -22,6 +22,14 @@ static int op_type = 0; static int test_unaryop(const ncnn::Mat& _a) { ncnn::Mat a = _a; + if (op_type == 2 || op_type == 3) + { + // large dynamic range for floor ceil + for (int i = 0; i < a.total(); i++) + { + a[i] *= 1000; + } + } if (op_type == 5 || op_type == 6 || op_type == 8) { // value must be positive for sqrt rsqrt log