Shortcuts

Struct UpsampleOptions

Page Contents

Struct Documentation

struct UpsampleOptions

Options for the Upsample module.

Example:

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

Public Functions

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

output spatial sizes.

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

multiplier for spatial size.

inline auto scale_factor(std::optional<std::vector<double>> &&new_scale_factor) -> decltype(*this)
inline const std::optional<std::vector<double>> &scale_factor() const noexcept
inline std::optional<std::vector<double>> &scale_factor() noexcept
inline auto mode(const mode_t &new_mode) -> decltype(*this)
inline auto mode(mode_t &&new_mode) -> decltype(*this)
inline const mode_t &mode() const noexcept
inline mode_t &mode() noexcept
inline auto align_corners(const std::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”

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