Peter Bell
8acf0e62d0
Use c10 math constants consistently in Math.h ( #91967 )
...
On MSVC the `M_` constants are hidden behind the `USE_MATH_DEFINES` macro, so
it's better to avoid them in headers otherwise the include order can break
compilation.
Pull Request resolved: https://github.com/pytorch/pytorch/pull/91967
Approved by: https://github.com/malfet
2023-01-12 11:53:52 +00:00
Nikita Shulga
087049000b
Make c10 clang-tidy clean ( #55870 )
...
Summary:
This change was autogenerated by running:
```
% find c10 -iname "*.cpp" -exec python3 tools/clang_tidy.py -c build -x {} -s \;
```
Pull Request resolved: https://github.com/pytorch/pytorch/pull/55870
Reviewed By: janeyx99
Differential Revision: D27728617
Pulled By: malfet
fbshipit-source-id: bede4d7f0c106d51394d1e9efddf01bf894421c5
2021-04-14 11:23:28 -07:00
Nikita Shulga
de8cd6b201
[BE] Replace M_PI with c10::pi constexpr variable ( #50819 )
...
Summary:
Also, get rid of MSVC specific `_USE_MATH_DEFINES`
Test at compile time that c10::pi<double> == M_PI
Pull Request resolved: https://github.com/pytorch/pytorch/pull/50819
Reviewed By: albanD
Differential Revision: D25976330
Pulled By: malfet
fbshipit-source-id: 8f3ddfd58a5aa4bd382da64ad6ecc679706d1284
2021-01-22 15:15:31 -08:00