From dc688beef61c2913ceeab40adee517b580d6c325 Mon Sep 17 00:00:00 2001 From: Yangqing Jia Date: Thu, 3 Oct 2013 23:19:13 -0700 Subject: [PATCH] caffe test convolution --- src/caffe/test/test_convolution_layer.cpp | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/src/caffe/test/test_convolution_layer.cpp b/src/caffe/test/test_convolution_layer.cpp index 5de33bc..fdd870f 100644 --- a/src/caffe/test/test_convolution_layer.cpp +++ b/src/caffe/test/test_convolution_layer.cpp @@ -151,6 +151,18 @@ TYPED_TEST(ConvolutionLayerTest, TestCPUGradient) { checker.CheckGradientExhaustive(layer, this->blob_bottom_vec_, this->blob_top_vec_); } +TYPED_TEST(ConvolutionLayerTest, TestCPUGradientGroup) { + LayerParameter layer_param; + layer_param.set_kernelsize(3); + layer_param.set_stride(2); + layer_param.set_num_output(3); + layer_param.set_group(3); + Caffe::set_mode(Caffe::CPU); + ConvolutionLayer layer(layer_param); + GradientChecker checker(1e-2, 1e-2); + checker.CheckGradientExhaustive(layer, this->blob_bottom_vec_, this->blob_top_vec_); +} + TYPED_TEST(ConvolutionLayerTest, TestGPUGradient) { LayerParameter layer_param; layer_param.set_kernelsize(3); @@ -162,4 +174,16 @@ TYPED_TEST(ConvolutionLayerTest, TestGPUGradient) { checker.CheckGradientExhaustive(layer, this->blob_bottom_vec_, this->blob_top_vec_); } +TYPED_TEST(ConvolutionLayerTest, TestGPUGradientGroup) { + LayerParameter layer_param; + layer_param.set_kernelsize(3); + layer_param.set_stride(2); + layer_param.set_num_output(3); + layer_param.set_group(3); + Caffe::set_mode(Caffe::GPU); + ConvolutionLayer layer(layer_param); + GradientChecker checker(1e-2, 1e-2); + checker.CheckGradientExhaustive(layer, this->blob_bottom_vec_, this->blob_top_vec_); +} + } -- 2.7.4