From 52eb86e30f6739a0d5ca115507b90f48bc8b89fd Mon Sep 17 00:00:00 2001 From: tensor-tang Date: Thu, 26 Jul 2018 23:19:54 +0800 Subject: [PATCH] refine im2col benchmark --- paddle/fluid/operators/math/im2col_test.cc | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-) diff --git a/paddle/fluid/operators/math/im2col_test.cc b/paddle/fluid/operators/math/im2col_test.cc index 7897be2ec3d..789d8e684a4 100644 --- a/paddle/fluid/operators/math/im2col_test.cc +++ b/paddle/fluid/operators/math/im2col_test.cc @@ -256,14 +256,11 @@ TEST(math, im2col_cputest) { /*pw*/ 2); // benchmark - LOG(INFO) << "padding == 0"; - benchIm2col(/*ic*/ 3, /*ih*/ 224, /*iw*/ 224, /*fh*/ 3, /*fw*/ 3, /*ph*/ 0, - /*pw*/ 0); - benchIm2col(/*ic*/ 3, /*ih*/ 224, /*iw*/ 224, /*fh*/ 5, /*fw*/ 5, /*ph*/ 0, - /*pw*/ 0); - LOG(INFO) << "padding == 1"; - benchIm2col(/*ic*/ 3, /*ih*/ 224, /*iw*/ 224, /*fh*/ 3, /*fw*/ 3, /*ph*/ 1, - /*pw*/ 1); - benchIm2col(/*ic*/ 3, /*ih*/ 224, /*iw*/ 224, /*fh*/ 5, /*fw*/ 5, /*ph*/ 1, - /*pw*/ 1); + for (int p : {0, 1, 2}) { + for (int k : {3, 5}) { + LOG(INFO) << "padding == " << p << ", filter == " << k; + benchIm2col(/*ic*/ 3, /*ih*/ 224, /*iw*/ 224, /*fh*/ k, /*fw*/ k, + /*ph*/ p, /*pw*/ p); + } + } } -- GitLab