fn
adaptive_max_pool3d
→Tensoradaptive_max_pool3d(x: Tensor, output_size: int | tuple[int, int, int], return_indices: bool = False)3-D adaptive max pooling — produces a fixed (D, H, W).
Volumetric analogue of adaptive_max_pool2d. Computes
per-axis kernel and stride so the output spatial shape exactly
matches output_size regardless of input shape.
Parameters
xTensorInput of shape
(N, C, D, H, W).output_sizeint or (int, int, int)Desired output spatial shape.
return_indicesbool= FalseMust currently be
False.Returns
TensorOutput of shape (N, C, oD, oH, oW).
Notes
The window for output cell is the 3-way product
of axis-wise floor / ceil intervals (see
adaptive_avg_pool2d for the 2-D version). The cell takes
the maximum over that volume:
Examples
>>> import lucid
>>> from lucid.nn.functional import adaptive_max_pool3d
>>> x = lucid.randn(1, 8, 5, 7, 9)
>>> y = adaptive_max_pool3d(x, output_size=(1, 1, 1))
>>> y.shape
(1, 8, 1, 1, 1)