aboutsummaryrefslogtreecommitdiff
path: root/src/armnnUtils/BFloat16.hpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/armnnUtils/BFloat16.hpp')
-rw-r--r--src/armnnUtils/BFloat16.hpp16
1 files changed, 11 insertions, 5 deletions
diff --git a/src/armnnUtils/BFloat16.hpp b/src/armnnUtils/BFloat16.hpp
index 5da4da559f..16ceb524c3 100644
--- a/src/armnnUtils/BFloat16.hpp
+++ b/src/armnnUtils/BFloat16.hpp
@@ -27,6 +27,17 @@ public:
m_Value = Float32ToBFloat16(v).Val();
}
+ operator float() const
+ {
+ return ToFloat32();
+ }
+
+ BFloat16& operator=(const BFloat16& other)
+ {
+ m_Value = other.Val();
+ return *this;
+ }
+
BFloat16& operator=(float v)
{
m_Value = Float32ToBFloat16(v).Val();
@@ -38,11 +49,6 @@ public:
return m_Value == r.Val();
}
- bool operator==(const float& r) const
- {
- return ToFloat32() == r;
- }
-
static BFloat16 Float32ToBFloat16(const float v)
{
if (std::isnan(v))