Shortcuts

Struct GridSampleFuncOptions

Page Contents

Struct Documentation

struct 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 std::variant<enumtype::kBilinear, enumtype::kNearest> mode_t
typedef std::variant<enumtype::kZeros, enumtype::kBorder, enumtype::kReflection> padding_mode_t

Public Functions

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

interpolation mode to calculate output values. Default: Bilinear

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

padding mode for outside grid values. Default: Zeros

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

Specifies perspective to pixel as point. Default: false.

inline auto align_corners(std::optional<bool> &&new_align_corners) -> decltype(*this)
inline const std::optional<bool> &align_corners() const noexcept
inline std::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