From f268ce139adc2258da71d42ac4b4ff9a26e5373b Mon Sep 17 00:00:00 2001 From: brightening-eyes Date: Fri, 22 Sep 2023 21:41:07 +0330 Subject: [PATCH] fix --- tests/test_range.cpp | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/tests/test_range.cpp b/tests/test_range.cpp index 0d13c02f2b7..7716700caa7 100644 --- a/tests/test_range.cpp +++ b/tests/test_range.cpp @@ -23,10 +23,14 @@ static int test_range(const ncnn::Mat& _a, const ncnn::Mat& _b, const ncnn::Mat& ncnn::Mat c = _c; // the values should be greater than 0 - RandomizeInt(a, 0, 100000); - RandomizeInt(b, a[0], a[0]* 10); + a = a.clone(); + RandomizeInt(a, 0, 100); + int* a_ptr = a; + b = b.clone(); + RandomizeInt(b, *a_ptr + 10, *a_ptr + 100); if(!c.empty()) - RandomizeInt(c, 1, 5); + c = c.clone(); + RandomizeInt(c, 1, 5); ncnn::ParamDict pd;