From 5a340b09bbec4991f0dc0a11b5d3c3244c312af4 Mon Sep 17 00:00:00 2001 From: Evan Shelhamer Date: Sat, 26 Apr 2014 14:42:38 -0700 Subject: [PATCH] set phase in dropout tests --- src/caffe/test/test_neuron_layer.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/caffe/test/test_neuron_layer.cpp b/src/caffe/test/test_neuron_layer.cpp index 9c852a1..5d74630 100644 --- a/src/caffe/test/test_neuron_layer.cpp +++ b/src/caffe/test/test_neuron_layer.cpp @@ -170,6 +170,7 @@ TYPED_TEST(NeuronLayerTest, TestDropoutCPU) { TYPED_TEST(NeuronLayerTest, TestDropoutGradientCPU) { LayerParameter layer_param; Caffe::set_mode(Caffe::CPU); + Caffe::set_phase(Caffe::TRAIN); DropoutLayer layer(layer_param); GradientChecker checker(1e-2, 1e-3); checker.CheckGradientEltwise(&layer, &(this->blob_bottom_vec_), @@ -219,6 +220,7 @@ TYPED_TEST(NeuronLayerTest, TestDropoutGradientGPU) { if (CAFFE_TEST_CUDA_PROP.major >= 2) { LayerParameter layer_param; Caffe::set_mode(Caffe::GPU); + Caffe::set_phase(Caffe::TRAIN); DropoutLayer layer(layer_param); GradientChecker checker(1e-2, 1e-3); // it is too expensive to call curand multiple times, so we don't do an -- 2.7.4