requantize_from_int Class — pytorch Architecture
Architecture documentation for the requantize_from_int class in AffineQuantizerBase.cpp from the pytorch codebase.
Entity Profile
Source Code
aten/src/ATen/native/quantized/AffineQuantizerBase.cpp lines 204–213
template <typename DST_T>
DST_T requantize_from_int(double multiplier, int64_t zero_point, int64_t src) {
int64_t quantize_down =
zero_point + lrintf(static_cast<float>(static_cast<double>(src) * multiplier));
// NOLINTNEXTLINE(bugprone-signed-char-misuse)
int32_t min = std::numeric_limits<typename DST_T::underlying>::min();
int32_t max = std::numeric_limits<typename DST_T::underlying>::max();
return static_cast<DST_T>(
std::min<int64_t>(std::max<int64_t>(quantize_down, min), max));
}
Source
Analyze Your Own Codebase
Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.
Try Supermodel Free