aboutsummaryrefslogtreecommitdiffhomepage
path: root/tensorflow/core/lib/hash/hash.h
diff options
context:
space:
mode:
Diffstat (limited to 'tensorflow/core/lib/hash/hash.h')
-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));