Shortcuts

Struct GridSampleFuncOptions

Page Contents

Struct Documentation

struct torch::nn::functional::GridSampleFuncOptions

Options for torch::nn::functional::grid_sample.

Example:

namespace F = torch::nn::functional;
F::grid_sample(input, grid, F::GridSampleFuncOptions().mode(torch::kBilinear).padding_mode(torch::kZeros).align_corners(true));

Public Types

typedef c10::variant<enumtype::kBilinear, enumtype::kNearest> mode_t
typedef c10::variant<enumtype::kZeros, enumtype::kBorder, enumtype::kReflection> padding_mode_t

Public Functions

auto mode(const mode_t &new_mode) -> decltype(*this)

interpolation mode to calculate output values. Default: Bilinear

auto mode(mode_t &&new_mode) -> decltype(*this)
const mode_t &mode() const noexcept
mode_t &mode() noexcept
auto padding_mode(const padding_mode_t &new_padding_mode) -> decltype(*this)

padding mode for outside grid values. Default: Zeros

auto padding_mode(padding_mode_t &&new_padding_mode) -> decltype(*this)
const padding_mode_t &padding_mode() const noexcept
padding_mode_t &padding_mode() noexcept
auto align_corners(const c10::optional<bool> &new_align_corners) -> decltype(*this)

Specifies perspective to pixel as point. Default: false.

auto align_corners(c10::optional<bool> &&new_align_corners) -> decltype(*this)
const c10::optional<bool> &align_corners() const noexcept
c10::optional<bool> &align_corners() noexcept

Docs

Access comprehensive developer documentation for PyTorch

View Docs

Tutorials

Get in-depth tutorials for beginners and advanced developers

View Tutorials

Resources

Find development resources and get your questions answered

View Resources