diff options
author | Akshay Naresh Modi <nareshmodi@google.com> | 2020-04-06 23:38:57 +0000 |
---|---|---|
committer | Rasmus Munk Larsen <rmlarsen@google.com> | 2020-04-06 23:38:57 +0000 |
commit | bcc0e9e15ceb2fc90acb64843bd2d6161d5f0c71 (patch) | |
tree | ac1bf5b6f31b1fdd083cc60f0ea4c2d12b90418d /Eigen/src/Core/util | |
parent | 54a0a9c9dd83aad42e79238ec8f0932b2a5e7881 (diff) |
Add numeric_limits min and max for bool
This will allow (among other things) computation of argmax and argmin of bool tensors
Diffstat (limited to 'Eigen/src/Core/util')
-rwxr-xr-x | Eigen/src/Core/util/Meta.h | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/Eigen/src/Core/util/Meta.h b/Eigen/src/Core/util/Meta.h index 301077fab..e9e2f1873 100755 --- a/Eigen/src/Core/util/Meta.h +++ b/Eigen/src/Core/util/Meta.h @@ -359,6 +359,15 @@ template<> struct numeric_limits<unsigned long long> EIGEN_DEVICE_FUNC static unsigned long long (min)() { return 0; } }; +template<> struct numeric_limits<bool> +{ + EIGEN_DEVICE_FUNC + static bool epsilon() { return false; } + EIGEN_DEVICE_FUNC + static bool (max)() { return true; } + EIGEN_DEVICE_FUNC + static bool (min)() { return false; } +}; } |