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 function
avg_pool_cpu
def avg_pool_cpu[dtype: DType, int_type: DType, rank: Int = Int(4), count_boundary: Bool = False](input: TileTensor[dtype, Storage=input.Storage, address_space=input.address_space, linear_idx_type=input.linear_idx_type], filter: TileTensor[int_type, Storage=filter.Storage, address_space=filter.address_space, linear_idx_type=filter.linear_idx_type], strides: TileTensor[int_type, Storage=strides.Storage, address_space=strides.address_space, linear_idx_type=strides.linear_idx_type], dilations: TileTensor[int_type, Storage=dilations.Storage, address_space=dilations.address_space, linear_idx_type=dilations.linear_idx_type], paddings: TileTensor[int_type, Storage=paddings.Storage, address_space=paddings.address_space, linear_idx_type=paddings.linear_idx_type], output: TileTensor[dtype, Storage=output.Storage, address_space=output.address_space, linear_idx_type=output.linear_idx_type], ceil_mode: Bool = False)
Computes the average pool.
Params: dtype: Data type of the input and output tensors. int_type: Data type of the filter, strides, dilations, and paddings tensors. rank: Rank of the input and output tensors (defaults to 4). count_boundary: Whether to count the boundary in the average computation.
Args:
- βinput (
TileTensor[dtype, Storage=input.Storage, address_space=input.address_space, linear_idx_type=input.linear_idx_type]): Batched image input to the pool2d operator. - βfilter (
TileTensor[int_type, Storage=filter.Storage, address_space=filter.address_space, linear_idx_type=filter.linear_idx_type]): Filter size on height and width dimensions with assumed tuple (filter_h, filter_w). - βstrides (
TileTensor[int_type, Storage=strides.Storage, address_space=strides.address_space, linear_idx_type=strides.linear_idx_type]): Strides on height and width dimensions with assumed tuple (stride_h, stride_w). - βdilations (
TileTensor[int_type, Storage=dilations.Storage, address_space=dilations.address_space, linear_idx_type=dilations.linear_idx_type]): Dilations on height and width dimensions with assumed tuple (dilation_h, dilation_w). - βpaddings (
TileTensor[int_type, Storage=paddings.Storage, address_space=paddings.address_space, linear_idx_type=paddings.linear_idx_type]): Paddings on height and width dimensions with assumed tuple (pad_h_before, pad_h_after, pad_w_before, pad_w_after)). - βoutput (
TileTensor[dtype, Storage=output.Storage, address_space=output.address_space, linear_idx_type=output.linear_idx_type]): Pre-allocated output tensor space. - βceil_mode (
Bool): Ceiling mode defines the output shape and implicit padding.
Was this page helpful?
Thank you! We'll create more content like this.
Thank you for helping us improve!