Shortcuts

Struct UpsampleOptions

Page Contents

Struct Documentation

struct torch::nn::UpsampleOptions

Options for the Upsample module.

Example:

Upsample model(UpsampleOptions().scale_factor(std::vector<double>({3})).mode(torch::kLinear).align_corners(false));

Public Functions

auto size(const c10::optional<std::vector<int64_t>> &new_size) -> decltype(*this)

output spatial sizes.

auto size(c10::optional<std::vector<int64_t>> &&new_size) -> decltype(*this)
const c10::optional<std::vector<int64_t>> &size() const noexcept
c10::optional<std::vector<int64_t>> &size() noexcept
auto scale_factor(const c10::optional<std::vector<double>> &new_scale_factor) -> decltype(*this)

multiplier for spatial size.

auto scale_factor(c10::optional<std::vector<double>> &&new_scale_factor) -> decltype(*this)
const c10::optional<std::vector<double>> &scale_factor() const noexcept
c10::optional<std::vector<double>> &scale_factor() noexcept
auto mode(const mode_t &new_mode) -> decltype(*this)
auto mode(mode_t &&new_mode) -> decltype(*this)
const mode_t &mode() const noexcept
mode_t &mode() noexcept
auto align_corners(const c10::optional<bool> &new_align_corners) -> decltype(*this)

if “True”, the corner pixels of the input and output tensors are aligned, and thus preserving the values at those pixels.

This only has effect when :attr:mode is “linear”, “bilinear”, “bicubic”, or “trilinear”. 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