summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRonghang Hu <huronghang@hotmail.com>2015-09-14 17:14:56 (GMT)
committerRonghang Hu <huronghang@hotmail.com>2015-09-14 17:14:56 (GMT)
commitf87658a257d81a4a9b065b65ab1e899bfa16656a (patch)
tree518570a73f8070ab442ce3e369b24397d209ebc1
parent5b3ad4dbe122bb751b3cac3fc854fe0bf7ab78ca (diff)
parent3456259d400f7eef27e07c15c34f22b8d5e13bdd (diff)
downloadcaffeonacl-f87658a257d81a4a9b065b65ab1e899bfa16656a.zip
caffeonacl-f87658a257d81a4a9b065b65ab1e899bfa16656a.tar.gz
caffeonacl-f87658a257d81a4a9b065b65ab1e899bfa16656a.tar.bz2
Merge pull request #3063 from ronghanghu/use-expectnear-in-eltwiselayertest
Use EXPECT_NEAR in EltwiseLayer test
-rw-r--r--src/caffe/test/test_eltwise_layer.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/caffe/test/test_eltwise_layer.cpp b/src/caffe/test/test_eltwise_layer.cpp
index be0c134..8031f6e 100644
--- a/src/caffe/test/test_eltwise_layer.cpp
+++ b/src/caffe/test/test_eltwise_layer.cpp
@@ -80,7 +80,7 @@ TYPED_TEST(EltwiseLayerTest, TestProd) {
const Dtype* in_data_b = this->blob_bottom_b_->cpu_data();
const Dtype* in_data_c = this->blob_bottom_c_->cpu_data();
for (int i = 0; i < count; ++i) {
- EXPECT_EQ(data[i], in_data_a[i] * in_data_b[i] * in_data_c[i]);
+ EXPECT_NEAR(data[i], in_data_a[i] * in_data_b[i] * in_data_c[i], 1e-4);
}
}
@@ -99,7 +99,7 @@ TYPED_TEST(EltwiseLayerTest, TestSum) {
const Dtype* in_data_b = this->blob_bottom_b_->cpu_data();
const Dtype* in_data_c = this->blob_bottom_c_->cpu_data();
for (int i = 0; i < count; ++i) {
- EXPECT_EQ(data[i], in_data_a[i] + in_data_b[i] + in_data_c[i]);
+ EXPECT_NEAR(data[i], in_data_a[i] + in_data_b[i] + in_data_c[i], 1e-4);
}
}