mirror of
https://github.com/pytorch/pytorch.git
synced 2025-10-20 12:54:11 +08:00
[11/N] Fix clang-tidy warnings in aten/src/ATen (#133298)
Follows #133155 Pull Request resolved: https://github.com/pytorch/pytorch/pull/133298 Approved by: https://github.com/ezyang
This commit is contained in:
@ -106,7 +106,7 @@ inline void _init(scalar_t* self_ptr, at::opmath_type<scalar_t>* buffer_ptr, int
|
||||
}
|
||||
|
||||
template <typename scalar_t>
|
||||
inline typename std::enable_if<!std::is_same<scalar_t, Vec2>::value, scalar_t>::type
|
||||
inline std::enable_if_t<!std::is_same_v<scalar_t, Vec2>, scalar_t>
|
||||
_max(const scalar_t& x, const scalar_t& y) {
|
||||
return at::_isnan(y) ? y : std::max(x, y);
|
||||
}
|
||||
@ -118,14 +118,14 @@ inline Vectorized<scalar_t> _max(const Vectorized<scalar_t>& x, const Vectorized
|
||||
}
|
||||
|
||||
template <typename vec_t>
|
||||
inline typename std::enable_if<std::is_same<vec_t, Vec2>::value, Vec2>::type
|
||||
inline std::enable_if_t<std::is_same_v<vec_t, Vec2>, Vec2>
|
||||
_max(const vec_t& x, const vec_t& y) {
|
||||
// vec::maximum propagates NaN
|
||||
return maximum(x, y);
|
||||
}
|
||||
|
||||
template <typename scalar_t>
|
||||
inline typename std::enable_if<!std::is_same<scalar_t, Vec2>::value, scalar_t>::type
|
||||
inline std::enable_if_t<!std::is_same_v<scalar_t, Vec2>, scalar_t>
|
||||
_min(const scalar_t& x, const scalar_t& y) {
|
||||
return at::_isnan(y) ? y : std::min(x, y);
|
||||
}
|
||||
@ -137,7 +137,7 @@ inline Vectorized<scalar_t> _min(const Vectorized<scalar_t>& x, const Vectorized
|
||||
}
|
||||
|
||||
template <typename vec_t>
|
||||
inline typename std::enable_if<std::is_same<vec_t, Vec2>::value, Vec2>::type
|
||||
inline std::enable_if_t<std::is_same_v<vec_t, Vec2>, Vec2>
|
||||
_min(const vec_t& x, const vec_t& y) {
|
||||
// vec::minimum propagates NaN
|
||||
return minimum(x, y);
|
||||
|
Reference in New Issue
Block a user