Skip to content

Commit

Permalink
Fix for a random failure in this test due to floating point compariso…
Browse files Browse the repository at this point in the history
…n. So, instead of exact match, used EXPECT_FLOAT_EQ that tolerates some precision while comparing two floats
  • Loading branch information
Nishidha Panpaliya committed Jul 11, 2016
1 parent 6f5f7c5 commit f1a8470
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/caffe/test/test_embed_layer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ TYPED_TEST(EmbedLayerTest, TestForwardWithBias) {
top_offset[4] = 0;
bias_offset[0] = 0;
for (int j = 0; j < kNumOutput; ++j) {
EXPECT_EQ(layer->blobs()[0]->data_at(weight_offset) +
EXPECT_FLOAT_EQ(layer->blobs()[0]->data_at(weight_offset) +
layer->blobs()[1]->data_at(bias_offset),
this->blob_top_->data_at(top_offset));
++top_offset[4];
Expand Down

1 comment on commit f1a8470

@cdluminate
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, this should fix the Debian package caffe-1.0.0~rc3-4 build failure on the i386 arch.

https://buildd.debian.org/status/fetch.php?pkg=caffe&arch=i386&ver=1.0.0~rc3-4&stamp=1469688514

Please sign in to comment.