CeilLog2 Class — pytorch Architecture
Architecture documentation for the CeilLog2 class in utils.h from the pytorch codebase.
Entity Profile
Source Code
aten/src/ATen/native/cpu/utils.h lines 136–144
template <typename T>
T CeilLog2(const T& x) {
if (x <= 2) {
return 1;
}
// Last set bit is floor(log2(x)), floor + 1 is ceil
// except when x is an exact powers of 2, so subtract 1 first
return static_cast<T>(llvm::findLastSet(static_cast<uint64_t>(x) - 1)) + 1;
}
Source
Analyze Your Own Codebase
Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.
Try Supermodel Free