aboutsummaryrefslogtreecommitdiffhomepage
path: root/tensorflow/core/lib/hash
diff options
context:
space:
mode:
authorGravatar A. Unique TensorFlower <gardener@tensorflow.org>2018-01-16 15:52:12 -0800
committerGravatar TensorFlower Gardener <gardener@tensorflow.org>2018-01-16 15:55:47 -0800
commitccbd14b741e6efbe51769f0f1b9cb3719c42c23b (patch)
treebcc79094e48982780b084cd19110d903186eea8f /tensorflow/core/lib/hash
parent287fe4f2404a7b69ffce89cc41ff3f049ca7a08b (diff)
Enable bfloat16 for CPU kernels
PiperOrigin-RevId: 182124532
Diffstat (limited to 'tensorflow/core/lib/hash')
-rw-r--r--tensorflow/core/lib/hash/hash.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/tensorflow/core/lib/hash/hash.h b/tensorflow/core/lib/hash/hash.h
index 0fb12966af..4d312ab7e8 100644
--- a/tensorflow/core/lib/hash/hash.h
+++ b/tensorflow/core/lib/hash/hash.h
@@ -65,6 +65,13 @@ struct hash<T*> {
};
template <>
+struct hash<bfloat16> {
+ size_t operator()(const bfloat16& t) const {
+ return std::hash<float>()(static_cast<float>(t));
+ }
+};
+
+template <>
struct hash<string> {
size_t operator()(const string& s) const {
return static_cast<size_t>(Hash64(s));