Mojo function
pool_shape_impl
pool_shape_impl[input_type: DType, filter_type: DType, strides_type: DType, dilations_type: DType, paddings_type: DType, ceil_mode: Bool](input_buf: TileTensor[input_type, address_space=input_buf.address_space, linear_idx_type=input_buf.linear_idx_type, element_size=input_buf.element_size], filter_buf: TileTensor[filter_type, address_space=filter_buf.address_space, linear_idx_type=filter_buf.linear_idx_type, element_size=filter_buf.element_size], strides_buf: TileTensor[strides_type, address_space=strides_buf.address_space, linear_idx_type=strides_buf.linear_idx_type, element_size=strides_buf.element_size], dilations_buf: TileTensor[dilations_type, address_space=dilations_buf.address_space, linear_idx_type=dilations_buf.linear_idx_type, element_size=dilations_buf.element_size], paddings_buf: TileTensor[paddings_type, address_space=paddings_buf.address_space, linear_idx_type=paddings_buf.linear_idx_type, element_size=paddings_buf.element_size]) -> IndexList[TileTensor[input_type, input_buf.LayoutType, input_buf.origin, address_space=input_buf.address_space, linear_idx_type=input_buf.linear_idx_type, element_size=input_buf.element_size].rank]
Compute the output shape of a pooling operation, and assert the inputs are compatible. Works for 2D pool operations only in the NHWC format.
Parameters:
- βinput_type (
DType): Type of the input tensor. - βfilter_type (
DType): Type of the filter tensor. - βstrides_type (
DType): Type of the strides tensor. - βdilations_type (
DType): Type of the dilations tensor. - βpaddings_type (
DType): Type of the paddings tensor. - βceil_mode (
Bool): Define rounding mode for shape calculation.
Args:
- βinput_buf (
TileTensor[input_type, address_space=input_buf.address_space, linear_idx_type=input_buf.linear_idx_type, element_size=input_buf.element_size]): The input tensor. - βfilter_buf (
TileTensor[filter_type, address_space=filter_buf.address_space, linear_idx_type=filter_buf.linear_idx_type, element_size=filter_buf.element_size]): The filter size buffer. - βstrides_buf (
TileTensor[strides_type, address_space=strides_buf.address_space, linear_idx_type=strides_buf.linear_idx_type, element_size=strides_buf.element_size]): The strides size buffer. - βdilations_buf (
TileTensor[dilations_type, address_space=dilations_buf.address_space, linear_idx_type=dilations_buf.linear_idx_type, element_size=dilations_buf.element_size]): The dilations size buffer. - βpaddings_buf (
TileTensor[paddings_type, address_space=paddings_buf.address_space, linear_idx_type=paddings_buf.linear_idx_type, element_size=paddings_buf.element_size]): The paddings size buffer.
Returns:
Was this page helpful?
Thank you! We'll create more content like this.
Thank you for helping us improve!