diff --git a/c10/util/BFloat16-math.h b/c10/util/BFloat16-math.h index 5ae993e7418..bad374cbd43 100644 --- a/c10/util/BFloat16-math.h +++ b/c10/util/BFloat16-math.h @@ -68,6 +68,12 @@ template < inline T expm1(T a) { return std::expm1(float(a)); } +template < + typename T, + typename std::enable_if_t, int> = 0> +inline bool isfinite(T a) { + return std::isfinite(float(a)); +} template < typename T, typename std::enable_if_t, int> = 0>