grid_sampler_unnormalize Class — pytorch Architecture
Architecture documentation for the grid_sampler_unnormalize class in GridSampler.h from the pytorch codebase.
Entity Profile
Source Code
aten/src/ATen/native/GridSampler.h lines 25–35
template <typename scalar_t>
static inline scalar_t grid_sampler_unnormalize(scalar_t coord, int64_t size,
bool align_corners) {
if (align_corners) {
// unnormalize coord from [-1, 1] to [0, size - 1]
return ((coord + 1) / 2) * (size - 1);
} else {
// unnormalize coord from [-1, 1] to [-0.5, size - 0.5]
return ((coord + 1) * size - 1) / 2;
}
}
Source
Analyze Your Own Codebase
Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.
Try Supermodel Free