adaptive_avg_pool3d(input: Tensor, output_size: int | tuple[int | None, ...])Implementing kernel
C++ engine symbols that back this Python API.3-D adaptive average pooling — produces a fixed (D, H, W).
Volumetric counterpart of adaptive_avg_pool2d. Used by
3-D classification heads to collapse a volumetric feature map to
a fixed embedding shape regardless of input size.
Parameters
inputTensorInput of shape
(N, C, D, H, W), or (C, D, H, W) unbatched.output_sizeint or (int or None, int or None, int or None)Desired
(oD, oH, oW); a single int applies to all three axes.Returns
TensorOutput of shape (N, C, oD, oH, oW).
Notes
Per-cell window definitions follow the same floor / ceil construction used in the 2-D variant. The cell value is the mean over the volumetric window:
When the input dims divide output_size evenly the engine path
is taken; otherwise a per-slot Python fallback runs (all data
stays on-device).
Examples
>>> import lucid
>>> from lucid.nn.functional import adaptive_avg_pool3d
>>> x = lucid.randn(1, 16, 8, 10, 10)
>>> y = adaptive_avg_pool3d(x, output_size=(2, 2, 2))
>>> y.shape
(1, 16, 2, 2, 2)