Mojo function
avg_pool_cpu
avg_pool_cpu[dtype: DType, int_type: DType, rank: Int = 4, count_boundary: Bool = False](input: TileTensor[dtype, address_space=input.address_space, linear_idx_type=input.linear_idx_type, element_size=input.element_size], filter: TileTensor[int_type, address_space=filter.address_space, linear_idx_type=filter.linear_idx_type, element_size=filter.element_size], strides: TileTensor[int_type, address_space=strides.address_space, linear_idx_type=strides.linear_idx_type, element_size=strides.element_size], dilations: TileTensor[int_type, address_space=dilations.address_space, linear_idx_type=dilations.linear_idx_type, element_size=dilations.element_size], paddings: TileTensor[int_type, address_space=paddings.address_space, linear_idx_type=paddings.linear_idx_type, element_size=paddings.element_size], output: TileTensor[dtype, address_space=output.address_space, linear_idx_type=output.linear_idx_type, element_size=output.element_size], ceil_mode: Bool = False)
Computes the average pool.
Params: count_boundary: Whether to count the boundary in the average computation.
Args:
- βinput (
TileTensor[dtype, address_space=input.address_space, linear_idx_type=input.linear_idx_type, element_size=input.element_size]): Batched image input to the pool2d operator. - βfilter (
TileTensor[int_type, address_space=filter.address_space, linear_idx_type=filter.linear_idx_type, element_size=filter.element_size]): Filter size on height and width dimensions with assumed tuple (filter_h, filter_w). - βstrides (
TileTensor[int_type, address_space=strides.address_space, linear_idx_type=strides.linear_idx_type, element_size=strides.element_size]): Strides on height and width dimensions with assumed tuple (stride_h, stride_w). - βdilations (
TileTensor[int_type, address_space=dilations.address_space, linear_idx_type=dilations.linear_idx_type, element_size=dilations.element_size]): Dilations on height and width dimensions with assumed tuple (dilation_h, dilation_w). - βpaddings (
TileTensor[int_type, address_space=paddings.address_space, linear_idx_type=paddings.linear_idx_type, element_size=paddings.element_size]): Paddings on height and width dimensions with assumed tuple (pad_h_before, pad_h_after, pad_w_before, pad_w_after)). - βoutput (
TileTensor[dtype, address_space=output.address_space, linear_idx_type=output.linear_idx_type, element_size=output.element_size]): 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!