|
|
@ -32,28 +32,6 @@ P_DECLARE_double(checkgrad_eps);
|
|
|
|
P_DECLARE_bool(thread_local_rand_use_global_seed);
|
|
|
|
P_DECLARE_bool(thread_local_rand_use_global_seed);
|
|
|
|
P_DECLARE_bool(prev_batch_state);
|
|
|
|
P_DECLARE_bool(prev_batch_state);
|
|
|
|
|
|
|
|
|
|
|
|
TEST(Layer, BilinearInterpLayer) {
|
|
|
|
|
|
|
|
TestConfig config;
|
|
|
|
|
|
|
|
config.layerConfig.set_type("bilinear_interp");
|
|
|
|
|
|
|
|
config.biasSize = 0;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
config.inputDefs.push_back({INPUT_DATA, "layer_0", 4096, 0});
|
|
|
|
|
|
|
|
LayerInputConfig* input = config.layerConfig.add_inputs();
|
|
|
|
|
|
|
|
BilinearInterpConfig* bilinear = input->mutable_bilinear_interp_conf();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
bilinear->set_img_size_x(32);
|
|
|
|
|
|
|
|
bilinear->set_img_size_y(32);
|
|
|
|
|
|
|
|
bilinear->set_num_channels(4);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
for (auto useGpu : {false, true}) {
|
|
|
|
|
|
|
|
for (auto out_size : {32, 64, 128}) {
|
|
|
|
|
|
|
|
bilinear->set_out_size_x(out_size);
|
|
|
|
|
|
|
|
bilinear->set_out_size_y(out_size);
|
|
|
|
|
|
|
|
testLayerGrad(config, "bilinear_interp", 10, false, useGpu);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
TEST(Operator, dot_mul) {
|
|
|
|
TEST(Operator, dot_mul) {
|
|
|
|
TestConfig config;
|
|
|
|
TestConfig config;
|
|
|
|
config.layerConfig.set_size(10);
|
|
|
|
config.layerConfig.set_size(10);
|
|
|
@ -197,6 +175,31 @@ TEST(Projection, conv) {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
TEST(Layer, BilinearInterpLayer) {
|
|
|
|
|
|
|
|
TestConfig config;
|
|
|
|
|
|
|
|
config.layerConfig.set_type("bilinear_interp");
|
|
|
|
|
|
|
|
config.biasSize = 0;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
config.inputDefs.push_back({INPUT_DATA, "layer_0", 4096, 0});
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
for (auto useGpu : {false, true}) {
|
|
|
|
|
|
|
|
for (auto out_size : {32, 64}) {
|
|
|
|
|
|
|
|
LOG(INFO) << " out_size_x=" << out_size
|
|
|
|
|
|
|
|
<< " out_size_y=" << out_size;
|
|
|
|
|
|
|
|
LayerInputConfig* input
|
|
|
|
|
|
|
|
= config.layerConfig.add_inputs();
|
|
|
|
|
|
|
|
BilinearInterpConfig* bilinear
|
|
|
|
|
|
|
|
= input->mutable_bilinear_interp_conf();
|
|
|
|
|
|
|
|
bilinear->set_img_size_x(32);
|
|
|
|
|
|
|
|
bilinear->set_img_size_y(32);
|
|
|
|
|
|
|
|
bilinear->set_num_channels(4);
|
|
|
|
|
|
|
|
bilinear->set_out_size_x(out_size);
|
|
|
|
|
|
|
|
bilinear->set_out_size_y(out_size);
|
|
|
|
|
|
|
|
testLayerGrad(config, "bilinear_interp", 10, false, useGpu);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
TEST(Layer, concat) {
|
|
|
|
TEST(Layer, concat) {
|
|
|
|
TestConfig config;
|
|
|
|
TestConfig config;
|
|
|
|
config.biasSize = 0;
|
|
|
|
config.biasSize = 0;
|
|
|
|