Struct PadFuncOptions¶
Defined in File padding.h
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 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¶
-
typedef std::variant<enumtype::kConstant, enumtype::kReflect, enumtype::kReplicate, enumtype::kCircular> mode_t¶