add_stub Class — pytorch Architecture
Architecture documentation for the add_stub class in PaddingKernel.cpp from the pytorch codebase.
Entity Profile
Source Code
aten/src/ATen/native/cpu/PaddingKernel.cpp lines 114–128
template <typename scalar_t>
inline void add_stub(scalar_t* grad_in, const scalar_t* grad_out, int64_t size) {
using Vec = Vectorized<scalar_t>;
int64_t d = 0;
for (; d < size - (size % Vec::size()); d += Vec::size()) {
Vec grad_vec = Vec::loadu(grad_in + d) + Vec::loadu(grad_out + d);
grad_vec.store(grad_in + d);
}
#if !defined(_MSC_VER) && !defined(COMPILING_FOR_MIN_SIZE)
# pragma unroll
#endif
for (; d < size; d++) {
grad_in[d] += grad_out[d];
}
}
Source
Analyze Your Own Codebase
Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.
Try Supermodel Free