mirror of
https://github.com/saymrwulf/pytorch.git
synced 2026-05-14 20:57:59 +00:00
[PyTorch] Add isfinite to BFloat16-math.h (#135052)
Missing function from <cmath>. Differential Revision: [D62148884](https://our.internmc.facebook.com/intern/diff/D62148884/) Pull Request resolved: https://github.com/pytorch/pytorch/pull/135052 Approved by: https://github.com/PaliC, https://github.com/albanD ghstack dependencies: #135031
This commit is contained in:
parent
7fe819d917
commit
a5d70cf545
1 changed files with 6 additions and 0 deletions
|
|
@ -68,6 +68,12 @@ template <
|
|||
inline T expm1(T a) {
|
||||
return std::expm1(float(a));
|
||||
}
|
||||
template <
|
||||
typename T,
|
||||
typename std::enable_if_t<is_reduced_floating_point_v<T>, int> = 0>
|
||||
inline bool isfinite(T a) {
|
||||
return std::isfinite(float(a));
|
||||
}
|
||||
template <
|
||||
typename T,
|
||||
typename std::enable_if_t<is_reduced_floating_point_v<T>, int> = 0>
|
||||
|
|
|
|||
Loading…
Reference in a new issue