Shortcuts

Struct ZeroPad2dOptions

Page Contents

Struct Documentation

struct torch::nn::ZeroPad2dOptions

Options for the ZeroPad2d module.

Example:

ZeroPad2d model(ZeroPad2dOptions({1, 1, 2, 0}));

Public Functions

ZeroPad2dOptions(ExpandingArray<4> padding)
auto padding(const ExpandingArray<4> &new_padding) -> decltype(*this)

The size of the padding.

  • If it is int, uses the same padding in all boundaries.

  • If it is a 4-tuple (for ZeroPad2d), uses (padding_left, padding_right, padding_top, padding_bottom).

auto padding(ExpandingArray<4> &&new_padding) -> decltype(*this)
const ExpandingArray<4> &padding() const noexcept
ExpandingArray<4> &padding() 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