Shortcuts

Struct PadFuncOptions

Page Contents

Struct Documentation

struct PadFuncOptions

Options for torch::nn::functional::pad.

Example:

namespace F = torch::nn::functional;
F::pad(input, F::PadFuncOptions({1, 2, 2, 1, 1,
2}).mode(torch::kReplicate));

Public Types

typedef std::variant<enumtype::kConstant, enumtype::kReflect, enumtype::kReplicate, enumtype::kCircular> mode_t

Public Functions

PadFuncOptions(std::vector<int64_t> pad)
inline auto pad(const std::vector<int64_t> &new_pad) -> decltype(*this)

m-elements tuple, where m/2 <= input dimensions and m is even.

inline auto pad(std::vector<int64_t> &&new_pad) -> decltype(*this)
inline const std::vector<int64_t> &pad() const noexcept
inline std::vector<int64_t> &pad() noexcept
inline auto mode(const mode_t &new_mode) -> decltype(*this)

“constant”, “reflect”, “replicate” or “circular”. Default: “constant”

inline auto mode(mode_t &&new_mode) -> decltype(*this)
inline const mode_t &mode() const noexcept
inline mode_t &mode() noexcept
inline auto value(const double &new_value) -> decltype(*this)

fill value for “constant” padding. Default: 0

inline auto value(double &&new_value) -> decltype(*this)
inline const double &value() const noexcept
inline double &value() 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