Rate this Page

Class FractionalMaxPool2dImpl#

Inheritance Relationships#

Base Type#

Class Documentation#

class FractionalMaxPool2dImpl : public torch::nn::Cloneable<FractionalMaxPool2dImpl>#

Applies fractional maxpool over a 2-D input.

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

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

Example:

FractionalMaxPool2d model(FractionalMaxPool2dOptions(5).output_size(1));

Public Functions

inline FractionalMaxPool2dImpl(ExpandingArray<2> kernel_size)#
explicit FractionalMaxPool2dImpl(FractionalMaxPool2dOptions options_)#
virtual void reset() override#

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

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

Pretty prints the FractionalMaxPool2d module into the given stream.

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

Returns the outputs and the indices of the max values.

Useful for torch::nn::MaxUnpool2d later.

Public Members

FractionalMaxPool2dOptions options#

The options with which this Module was constructed.

Tensor _random_samples#