Skip to content

Commit 1c9f6f7

Browse files
committed
Update
1 parent c8091ad commit 1c9f6f7

File tree

1 file changed

+25
-22
lines changed

1 file changed

+25
-22
lines changed

paddle/gserver/tests/test_LayerGrad.cpp

Lines changed: 25 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -32,28 +32,6 @@ P_DECLARE_double(checkgrad_eps);
3232
P_DECLARE_bool(thread_local_rand_use_global_seed);
3333
P_DECLARE_bool(prev_batch_state);
3434

35-
TEST(Layer, BilinearInterpLayer) {
36-
TestConfig config;
37-
config.layerConfig.set_type("bilinear_interp");
38-
config.biasSize = 0;
39-
40-
config.inputDefs.push_back({INPUT_DATA, "layer_0", 4096, 0});
41-
LayerInputConfig* input = config.layerConfig.add_inputs();
42-
BilinearInterpConfig* bilinear = input->mutable_bilinear_interp_conf();
43-
44-
bilinear->set_img_size_x(32);
45-
bilinear->set_img_size_y(32);
46-
bilinear->set_num_channels(4);
47-
48-
for (auto useGpu : {false, true}) {
49-
for (auto out_size : {32, 64, 128}) {
50-
bilinear->set_out_size_x(out_size);
51-
bilinear->set_out_size_y(out_size);
52-
testLayerGrad(config, "bilinear_interp", 10, false, useGpu);
53-
}
54-
}
55-
}
56-
5735
TEST(Operator, dot_mul) {
5836
TestConfig config;
5937
config.layerConfig.set_size(10);
@@ -197,6 +175,31 @@ TEST(Projection, conv) {
197175
}
198176
#endif
199177

178+
TEST(Layer, BilinearInterpLayer) {
179+
TestConfig config;
180+
config.layerConfig.set_type("bilinear_interp");
181+
config.biasSize = 0;
182+
183+
config.inputDefs.push_back({INPUT_DATA, "layer_0", 4096, 0});
184+
185+
for (auto useGpu : {false, true}) {
186+
for (auto out_size : {32, 64}) {
187+
LOG(INFO) << " out_size_x=" << out_size
188+
<< " out_size_y=" << out_size;
189+
LayerInputConfig* input
190+
= config.layerConfig.add_inputs();
191+
BilinearInterpConfig* bilinear
192+
= input->mutable_bilinear_interp_conf();
193+
bilinear->set_img_size_x(32);
194+
bilinear->set_img_size_y(32);
195+
bilinear->set_num_channels(4);
196+
bilinear->set_out_size_x(out_size);
197+
bilinear->set_out_size_y(out_size);
198+
testLayerGrad(config, "bilinear_interp", 10, false, useGpu);
199+
}
200+
}
201+
}
202+
200203
TEST(Layer, concat) {
201204
TestConfig config;
202205
config.biasSize = 0;

0 commit comments

Comments
 (0)