c10/util/BFloat16-math.h has undefined behavior #144495
Labels
module: build
Build system issues
module: core aten
Related to change to the Core ATen opset
triaged
This issue has been looked at a team member, and triaged and prioritized into an appropriate module
Uh oh!
There was an error while loading. Please reload this page.
🐛 Describe the bug
Per https://en.cppreference.com/w/cpp/language/extending_std:
The "exceptions noted below" do not seem to include what we're doing in BFloat16-math.h, and specifically don't include adding overloads of functions that take program-defined types.
This problem is currently "theoretical" in that I am not aware of practical issues resulting from this header at this time.
To fix this, we would need to at least put the functions in BFloat16-math.h into a namespace other than
std
(eitherc10
or a new one, like sayc10_math
). Then, we could either:using std::pow
and all the other cmath functions, and rely on ADL to select the c10/c10_math version for half/BFloat16using
all the std:: functions into our namespace (which IMO argues toward that namespace being a new one likec10_math
).Versions
N/A
cc @malfet @seemethere @manuelcandales @SherlockNoMad @angelayi
The text was updated successfully, but these errors were encountered: