Make lint happy
authorSergio <sguada@gmail.com>
Tue, 27 May 2014 18:06:56 +0000 (11:06 -0700)
committerSergio <sguada@gmail.com>
Tue, 27 May 2014 18:06:56 +0000 (11:06 -0700)
src/caffe/layers/threshold_layer.cpp
src/caffe/test/test_threshold_layer.cpp

index bec89cd..e6ed8a6 100644 (file)
@@ -22,7 +22,7 @@ Dtype ThresholdLayer<Dtype>::Forward_cpu(const vector<Blob<Dtype>*>& bottom,
   Dtype* top_data = (*top)[0]->mutable_cpu_data();
   const int count = bottom[0]->count();
   for (int i = 0; i < count; ++i) {
-    top_data[i] = ( bottom_data[i] > threshold_) ? Dtype(1) : Dtype(0);
+    top_data[i] = (bottom_data[i] > threshold_) ? Dtype(1) : Dtype(0);
   }
   return Dtype(0);
 }
index b8f9d96..8303e44 100644 (file)
@@ -65,10 +65,10 @@ TYPED_TEST(ThresholdLayerTest, TestCPU) {
     EXPECT_GE(top_data[i], 0.);
     EXPECT_LE(top_data[i], 1.);
     if (top_data[i] == 0) {
-       EXPECT_LE(bottom_data[i],threshold_);
+      EXPECT_LE(bottom_data[i], threshold_);
     }
     if (top_data[i] == 1) {
-       EXPECT_GT(bottom_data[i],threshold_);
+      EXPECT_GT(bottom_data[i], threshold_);
     }
   }
 }
@@ -86,15 +86,15 @@ TYPED_TEST(ThresholdLayerTest, TestCPU2) {
   const TypeParam* bottom_data = this->blob_bottom_->cpu_data();
   const TypeParam* top_data = this->blob_top_->cpu_data();
   const TypeParam threshold_ = layer_param.threshold_param().threshold();
-  EXPECT_FLOAT_EQ(threshold_,0.5);
+  EXPECT_FLOAT_EQ(threshold_, 0.5);
   for (int i = 0; i < this->blob_bottom_->count(); ++i) {
     EXPECT_GE(top_data[i], 0.);
     EXPECT_LE(top_data[i], 1.);
     if (top_data[i] == 0) {
-       EXPECT_LE(bottom_data[i],threshold_);
+      EXPECT_LE(bottom_data[i], threshold_);
     }
     if (top_data[i] == 1) {
-       EXPECT_TRUE(bottom_data[i] > threshold_); 
+      EXPECT_GT(bottom_data[i], threshold_);
     }
   }
 }
@@ -113,10 +113,10 @@ TYPED_TEST(ThresholdLayerTest, TestGPU) {
     EXPECT_GE(top_data[i], 0.);
     EXPECT_LE(top_data[i], 1.);
     if (top_data[i] == 0) {
-  EXPECT_LE(bottom_data[i],threshold_);
+      EXPECT_LE(bottom_data[i], threshold_);
     }
     if (top_data[i] == 1) {
-  EXPECT_GT(bottom_data[i],threshold_);
+      EXPECT_GT(bottom_data[i], threshold_);
     }
   }
 }
@@ -134,15 +134,15 @@ TYPED_TEST(ThresholdLayerTest, TestGPU2) {
   const TypeParam* bottom_data = this->blob_bottom_->cpu_data();
   const TypeParam* top_data = this->blob_top_->cpu_data();
   const TypeParam threshold_ = layer_param.threshold_param().threshold();
-  EXPECT_FLOAT_EQ(threshold_,0.5);
+  EXPECT_FLOAT_EQ(threshold_, 0.5);
   for (int i = 0; i < this->blob_bottom_->count(); ++i) {
     EXPECT_GE(top_data[i], 0.);
     EXPECT_LE(top_data[i], 1.);
     if (top_data[i] == 0) {
-  EXPECT_LE(bottom_data[i],threshold_);
+      EXPECT_LE(bottom_data[i], threshold_);
     }
     if (top_data[i] == 1) {
-  EXPECT_TRUE(bottom_data[i] > threshold_); 
+      EXPECT_GT(bottom_data[i], threshold_);
     }
   }
 }