Shortcuts

Struct PadFuncOptions

Page Contents

Struct Documentation

struct torch::nn::functional::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 c10::variant<enumtype::kConstant, enumtype::kReflect, enumtype::kReplicate, enumtype::kCircular> mode_t

Public Functions

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

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

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

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

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

fill value for “constant” padding. Default: 0

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