Rate this Page

Class AdaptiveMaxPool2dImpl#

Inheritance Relationships#

Base Type#

Class Documentation#

class AdaptiveMaxPool2dImpl : public torch::nn::AdaptiveMaxPoolImpl<2, ExpandingArrayWithOptionalElem<2>, AdaptiveMaxPool2dImpl>#

Applies adaptive maxpool over a 2-D input.

See https://pytorch.org/docs/main/nn.html#torch.nn.AdaptiveMaxPool2d to learn about the exact behavior of this module.

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

Example:

AdaptiveMaxPool2d model(AdaptiveMaxPool2dOptions({3, 2}));

Public Functions

Tensor forward(const Tensor &input)#
std::tuple<Tensor, Tensor> forward_with_indices(const Tensor &input)#

Returns the indices along with the outputs.

Useful to pass to nn.MaxUnpool2d.