diff options
Diffstat (limited to 'tensorflow/core/framework/bfloat16_test.cc')
-rw-r--r-- | tensorflow/core/framework/bfloat16_test.cc | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/tensorflow/core/framework/bfloat16_test.cc b/tensorflow/core/framework/bfloat16_test.cc index 206396a25a..0a1b5e1975 100644 --- a/tensorflow/core/framework/bfloat16_test.cc +++ b/tensorflow/core/framework/bfloat16_test.cc @@ -45,7 +45,8 @@ class Bfloat16Test : public ::testing::Test, public ::testing::WithParamInterface<Bfloat16TestParam> {}; TEST_P(Bfloat16Test, TruncateTest) { - bfloat16 truncated(GetParam().input); + bfloat16 truncated = bfloat16::truncate_to_bfloat16((GetParam().input)); + if (std::isnan(GetParam().input)) { EXPECT_TRUE(std::isnan(float(truncated)) || std::isinf(float(truncated))); return; |