Home / Class/ upsample_get_value_bounded Class — pytorch Architecture

upsample_get_value_bounded Class — pytorch Architecture

Architecture documentation for the upsample_get_value_bounded class in UpSample.h from the pytorch codebase.

Entity Profile

Source Code

aten/src/ATen/native/UpSample.h lines 371–381

template <typename scalar_t>
scalar_t upsample_get_value_bounded(
    scalar_t* data,
    int64_t width,
    int64_t height,
    int64_t x,
    int64_t y) {
  int64_t access_x = std::max(std::min(x, width - 1), static_cast<int64_t>(0));
  int64_t access_y = std::max(std::min(y, height - 1), static_cast<int64_t>(0));
  return data[access_y * width + access_x];
}

Analyze Your Own Codebase

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

Try Supermodel Free