Home / Class/ safe_add_2d Class — pytorch Architecture

safe_add_2d Class — pytorch Architecture

Architecture documentation for the safe_add_2d class in GridSampler.h from the pytorch codebase.

Entity Profile

Source Code

aten/src/ATen/native/GridSampler.h lines 236–243

template<typename scalar_t>
static inline void safe_add_2d(scalar_t *data, int64_t h, int64_t w,
                               int64_t sH, int64_t sW, int64_t H, int64_t W,
                               scalar_t delta) {
  if (within_bounds_2d(h, w, H, W)) {
    data[h * sH + w * sW] += delta;
  }
}

Analyze Your Own Codebase

Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.

Try Supermodel Free