Two-Dimensional Pooling Adapters #
The fixed-window operations in this file are two-dimensional views of the rank-polymorphic
definitions in NN.Spec.Layers.Pooling.ND. They retain the conventional maxPool2d and
avgPool2d names used by model APIs and PyTorch interchange, but do not define a second pooling
semantics.
Adaptive pooling remains genuinely two-dimensional here because its variable-size binning is a different operation from fixed-kernel N-D pooling.
Output shape for unpadded single-channel two-dimensional pooling.
Instances For
Output shape for unpadded channel-first two-dimensional pooling.
Instances For
Output shape for single-channel two-dimensional pooling with symmetric padding.
Instances For
Output shape for channel-first two-dimensional pooling with symmetric padding.
Instances For
Fixed-window adapters #
Single-channel two-dimensional max pooling, specialized from maxPoolSpatialSpec.
Instances For
Channel-first two-dimensional max pooling, specialized from maxPoolSpec.
Instances For
Selected-branch JVP for single-channel two-dimensional hard max pooling.
Instances For
Selected-branch JVP for channel-first two-dimensional hard max pooling.
Instances For
Single-channel two-dimensional average pooling, specialized from avgPoolSpatialSpec.
Instances For
Channel-first two-dimensional average pooling, specialized from avgPoolSpec.
Instances For
VJP for single-channel two-dimensional max pooling.
Instances For
VJP for channel-first two-dimensional max pooling.
Instances For
VJP for single-channel two-dimensional average pooling.
Instances For
Smooth max pooling #
Single-channel smooth max pooling using the N-D log-sum-exp specification.
Instances For
Channel-first smooth max pooling using the N-D log-sum-exp specification.
Instances For
JVP for single-channel smooth max pooling.
Instances For
JVP for channel-first smooth max pooling.
Instances For
Adaptive pooling #
Witness for adaptive average pooling to a fixed two-dimensional output shape.
Instances For
Witness for adaptive max pooling to a fixed two-dimensional output shape.
Instances For
Start of adaptive-pooling bin i: floor(i * input / output).
Instances For
End of adaptive-pooling bin i: ceil((i + 1) * input / output).
Instances For
Two-dimensional adaptive average pooling with PyTorch-compatible bins.
Instances For
Two-dimensional adaptive max pooling with PyTorch-compatible bins.