is_integral_v Class — pytorch Architecture
Architecture documentation for the is_integral_v class in Utils.h from the pytorch codebase.
Entity Profile
Source Code
aten/src/ATen/native/vulkan/api/Utils.h lines 167–181
template <typename To, typename From>
std::enable_if_t<std::is_integral_v<From> && !std::is_same_v<From, bool>, bool>
overflows(From f) {
using limit = std::numeric_limits<To>;
// Casting from signed to unsigned; allow for negative numbers to wrap using
// two's complement arithmetic.
if (!limit::is_signed && std::numeric_limits<From>::is_signed) {
return greater_than_max<To>(f) ||
(is_negative(f) && -static_cast<uint64_t>(f) > limit::max());
}
// standard case, check if f is outside the range of type To
else {
return less_than_lowest<To>(f) || greater_than_max<To>(f);
}
}
Source
Analyze Your Own Codebase
Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.
Try Supermodel Free