From f27ff4d8a4e1370ceff5d3082bef8b712b1b23cb Mon Sep 17 00:00:00 2001 From: liaogang Date: Thu, 10 Nov 2016 11:06:02 +0800 Subject: [PATCH] Revise code --- paddle/gserver/tests/test_LayerGrad.cpp | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/paddle/gserver/tests/test_LayerGrad.cpp b/paddle/gserver/tests/test_LayerGrad.cpp index c1f7876c1..55a6f66ac 100644 --- a/paddle/gserver/tests/test_LayerGrad.cpp +++ b/paddle/gserver/tests/test_LayerGrad.cpp @@ -187,15 +187,13 @@ TEST(Layer, BilinearInterpLayer) { bilinear->set_img_size_y(32); bilinear->set_num_channels(4); - bilinear->set_out_size_x(32); - bilinear->set_out_size_y(32); - testLayerGrad(config, "bilinear_interp", 10, false, false); - testLayerGrad(config, "bilinear_interp", 10, false, true); - - bilinear->set_out_size_x(64); - bilinear->set_out_size_y(64); - testLayerGrad(config, "bilinear_interp", 10, false, false); - testLayerGrad(config, "bilinear_interp", 10, false, true); + for (auto useGpu : {false, true}) { + for (auto outSize : {32, 64}) { + bilinear->set_out_size_x(outSize); + bilinear->set_out_size_y(outSize); + testLayerGrad(config, "bilinear_interp", 10, false, useGpu); + } + } } TEST(Layer, concat) { -- GitLab