提交 22146f82 编写于 作者: Y yejianwu

update out_of_range unit test

上级 ed095d40
...@@ -9,8 +9,6 @@ ...@@ -9,8 +9,6 @@
#include "mace/core/tensor.h" #include "mace/core/tensor.h"
#include "mace/core/workspace.h" #include "mace/core/workspace.h"
#include "mace/kernels/opencl/helper.h" #include "mace/kernels/opencl/helper.h"
#include "mace/utils/tuner.h"
#include "mace/utils/utils.h"
namespace mace { namespace mace {
namespace kernels { namespace kernels {
...@@ -121,6 +119,7 @@ class OutOfRangeCheckTest : public ::testing::Test { ...@@ -121,6 +119,7 @@ class OutOfRangeCheckTest : public ::testing::Test {
TEST(OutOfRangeCheckTest, RandomTest) { TEST(OutOfRangeCheckTest, RandomTest) {
static unsigned int seed = time(NULL); static unsigned int seed = time(NULL);
for (int round = 0; round < 10; ++round) {
index_t batch = 11 + rand_r(&seed) % 10; index_t batch = 11 + rand_r(&seed) % 10;
index_t height = 12 + rand_r(&seed) % 100; index_t height = 12 + rand_r(&seed) % 100;
index_t width = 13 + rand_r(&seed) % 100; index_t width = 13 + rand_r(&seed) % 100;
...@@ -146,6 +145,7 @@ TEST(OutOfRangeCheckTest, RandomTest) { ...@@ -146,6 +145,7 @@ TEST(OutOfRangeCheckTest, RandomTest) {
overflow_image_shape[i] += 1; overflow_image_shape[i] += 1;
} }
ASSERT_TRUE(BufferToImageOpImpl(buffer, image, overflow_image_shape)); ASSERT_TRUE(BufferToImageOpImpl(buffer, image, overflow_image_shape));
}
} }
} // namespace kernels } // namespace kernels
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册