Skip to content

Commit

Permalink
[unittests] Increase allowed error threshold while comparing floating
Browse files Browse the repository at this point in the history
point tensors in BackendCorrectnessTest.
  • Loading branch information
aturetsk authored and jfix71 committed Oct 12, 2018
1 parent 71c49e0 commit e0d3754
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions tests/unittests/BackendCorrectnessTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ using CreateAndInitFunction =
static bool
compareAgainstInterpreter(BackendKind backendKind,
CreateAndInitFunction createAndInitFunction,
bool quantize) {
bool quantize, float allowedError = 0.0001) {
ExecutionEngine IEE{BackendKind::Interpreter};
ExecutionEngine BEE{backendKind};
Context ICtx, BCtx;
Expand All @@ -95,7 +95,7 @@ compareAgainstInterpreter(BackendKind backendKind,
IEE.run();
BEE.run();

return IFT.second->isEqual(*BFT.second);
return IFT.second->isEqual(*BFT.second, allowedError);
}

} // namespace
Expand Down Expand Up @@ -496,7 +496,7 @@ TEST_P(BackendCorrectnessTest, convOps) {

TEST_P(BackendCorrectnessTest, basicFCNet) {
EXPECT_TRUE(compareAgainstInterpreter(GetParam(), createAndInitBasicFCNet,
/* quantize */ false));
/* quantize */ false, 0.0002));
}

TEST_P(BackendCorrectnessTest, basicFCNetQuantized) {
Expand Down

0 comments on commit e0d3754

Please # to comment.