aboutsummaryrefslogtreecommitdiffhomepage
path: root/tensorflow/core/framework/bfloat16_test.cc
diff options
context:
space:
mode:
authorGravatar A. Unique TensorFlower <gardener@tensorflow.org>2017-10-02 10:18:01 -0700
committerGravatar TensorFlower Gardener <gardener@tensorflow.org>2017-10-02 10:22:03 -0700
commitc0644791cfc064d5e4652271e51d826aeccad0c2 (patch)
treebe0f6fe47be1b464dfe99394c15101298900e859 /tensorflow/core/framework/bfloat16_test.cc
parent3c00952c6680d77ee2f10def35fbc7cbd138aea3 (diff)
Change bfloat constructor to accept a float to avoid truncation in implicit conversion from non-integer types to uint16_t.
PiperOrigin-RevId: 170717628
Diffstat (limited to 'tensorflow/core/framework/bfloat16_test.cc')
-rw-r--r--tensorflow/core/framework/bfloat16_test.cc3
1 files changed, 2 insertions, 1 deletions
diff --git a/tensorflow/core/framework/bfloat16_test.cc b/tensorflow/core/framework/bfloat16_test.cc
index 5bd95b806f..af4e6a4411 100644
--- a/tensorflow/core/framework/bfloat16_test.cc
+++ b/tensorflow/core/framework/bfloat16_test.cc
@@ -23,7 +23,8 @@ namespace {
TEST(Bfloat16Test, Simple) {
bfloat16 a(12);
- EXPECT_EQ(12, a.value);
+ // Floating point representation of 12: 0x41400000
+ EXPECT_EQ(0x4140, a.value);
}
TEST(Bfloat16Test, Conversion) {