IMPORTANT: To view this page as Markdown, append `.md` to the URL (e.g. /max/get-started.md). For the complete documentation index, see llms.txt.
Skip to main content
For the complete documentation index, see llms.txt. Markdown versions of all pages are available by appending .md to any URL (e.g. /max/get-started.md).

Mojo module

pool

Provides average- and max-pooling kernels with configurable padding, dilation, and stride for CPU and GPU.

Structs​

  • ​PoolMethod: Represents the pooling method, selecting between max and average pooling.

Functions​

  • ​avg_pool: Dispatches the average pooling operation to the CPU or GPU backend based on the target.
  • ​avg_pool_cpu: Computes the average pool.
  • ​avg_pool_gpu: Computes the average pool on GPU.
  • ​max_pool: Dispatches the max pooling operation to the CPU or GPU backend based on the target.
  • ​max_pool_cpu: Computes fp32 pooling.
  • ​max_pool_gpu: Computes max pooling on GPU.
  • ​pool_shape: Computes the output shape of a pooling operation using floor rounding for the spatial dimensions.
  • ​pool_shape_ceil: Computes the output shape of a pooling operation using ceil rounding for the spatial dimensions.
  • ​pool_shape_impl: Compute the output shape of a pooling operation, and assert the inputs are compatible. Works for 2D pool operations only in the NHWC format.