Class ZeroPad2dImpl

Inheritance Relationships

Base Type

Class Documentation

class torch::nn::ZeroPad2dImpl : public torch::nn::Cloneable<ZeroPad2dImpl>

Applies ZeroPad over a 2-D input.

See to learn about the exact behavior of this module.

See the documentation for torch::nn::ZeroPad2dOptions class to learn what constructor arguments are supported for this module.


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

Public Functions

ZeroPad2dImpl(ExpandingArray<4> padding)
ZeroPad2dImpl(const ZeroPad2dOptions &options_)
void reset() override

reset() must perform initialization of all members with reference semantics, most importantly parameters, buffers and submodules.

void pretty_print(std::ostream &stream) const override

Pretty prints the ZeroPad2d module into the given stream.

Tensor forward(const Tensor &input)

Public Members

ZeroPad2dOptions options

The options with which this Module was constructed.


Access comprehensive developer documentation for PyTorch

View Docs


Get in-depth tutorials for beginners and advanced developers

View Tutorials


Find development resources and get your questions answered

View Resources