Skip to content

Commit

Permalink
fix lint errors that snuck in by #4566
Browse files Browse the repository at this point in the history
  • Loading branch information
shelhamer committed Apr 14, 2017
1 parent 68215cc commit 8007349
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 7 deletions.
12 changes: 8 additions & 4 deletions src/caffe/test/test_gradient_based_solver.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -558,9 +558,11 @@ class GradientBasedSolverTest : public MultiDeviceTest<TypeParam> {
const vector<Blob<Dtype>*>& params = solver_->net()->learnable_params();
for (int i = 0; i < params.size(); ++i) {
for (int j = 0; j < params[i]->count(); ++j) {
EXPECT_FLOAT_EQ(param_copies[i]->cpu_data()[j], params[i]->cpu_data()[j])
EXPECT_FLOAT_EQ(param_copies[i]->cpu_data()[j],
params[i]->cpu_data()[j])
<< "param " << i << " data differed at dim " << j;
EXPECT_FLOAT_EQ(param_copies[i]->cpu_diff()[j], params[i]->cpu_diff()[j])
EXPECT_FLOAT_EQ(param_copies[i]->cpu_diff()[j],
params[i]->cpu_diff()[j])
<< "param " << i << " diff differed at dim " << j;
}
}
Expand All @@ -569,9 +571,11 @@ class GradientBasedSolverTest : public MultiDeviceTest<TypeParam> {
const vector<shared_ptr<Blob<Dtype> > >& history = solver_->history();
for (int i = 0; i < history.size(); ++i) {
for (int j = 0; j < history[i]->count(); ++j) {
EXPECT_FLOAT_EQ(history_copies[i]->cpu_data()[j], history[i]->cpu_data()[j])
EXPECT_FLOAT_EQ(history_copies[i]->cpu_data()[j],
history[i]->cpu_data()[j])
<< "history blob " << i << " data differed at dim " << j;
EXPECT_FLOAT_EQ(history_copies[i]->cpu_diff()[j], history[i]->cpu_diff()[j])
EXPECT_FLOAT_EQ(history_copies[i]->cpu_diff()[j],
history[i]->cpu_diff()[j])
<< "history blob " << i << " diff differed at dim " << j;
}
}
Expand Down
9 changes: 6 additions & 3 deletions src/caffe/test/test_neuron_layer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -791,13 +791,16 @@ TYPED_TEST(NeuronLayerTest, TestPReLUInPlace) {
ip2.Backward(blob_middle_vec_2, propagate_down, blob_bottom_vec_2);
// Check numbers
for (int s = 0; s < blob_bottom_2->count(); ++s) {
EXPECT_FLOAT_EQ(this->blob_bottom_->cpu_diff()[s], blob_bottom_2->cpu_diff()[s]);
EXPECT_FLOAT_EQ(this->blob_bottom_->cpu_diff()[s],
blob_bottom_2->cpu_diff()[s]);
}
for (int s = 0; s < ip.blobs()[0]->count(); ++s) {
EXPECT_FLOAT_EQ(ip.blobs()[0]->cpu_diff()[s], ip2.blobs()[0]->cpu_diff()[s]);
EXPECT_FLOAT_EQ(ip.blobs()[0]->cpu_diff()[s],
ip2.blobs()[0]->cpu_diff()[s]);
}
for (int s = 0; s < ip.blobs()[1]->count(); ++s) {
EXPECT_FLOAT_EQ(ip.blobs()[1]->cpu_diff()[s], ip2.blobs()[1]->cpu_diff()[s]);
EXPECT_FLOAT_EQ(ip.blobs()[1]->cpu_diff()[s],
ip2.blobs()[1]->cpu_diff()[s]);
}
for (int s = 0; s < prelu.blobs()[0]->count(); ++s) {
EXPECT_FLOAT_EQ(prelu.blobs()[0]->cpu_diff()[s],
Expand Down

0 comments on commit 8007349

Please sign in to comment.