.. index:: pair: group; Pooling .. _doxid-group__dnnl__api__pooling: Pooling ======= .. toctree:: :hidden: struct_dnnl_pooling_backward.rst struct_dnnl_pooling_forward.rst Overview ~~~~~~~~ A primitive to perform max or average pooling with dilation. :ref:`More...` .. ref-code-block:: cpp :class: doxyrest-overview-code-block // structs struct :ref:`dnnl::pooling_backward`; struct :ref:`dnnl::pooling_forward`; // global functions :ref:`dnnl_status_t` DNNL_API :ref:`dnnl_pooling_forward_primitive_desc_create`( :ref:`dnnl_primitive_desc_t`* primitive_desc, :ref:`dnnl_engine_t` engine, :ref:`dnnl_prop_kind_t` prop_kind, :ref:`dnnl_alg_kind_t` alg_kind, :ref:`const_dnnl_memory_desc_t` src_desc, :ref:`const_dnnl_memory_desc_t` dst_desc, const :ref:`dnnl_dims_t` strides, const :ref:`dnnl_dims_t` kernel, const :ref:`dnnl_dims_t` dilation, const :ref:`dnnl_dims_t` padding_l, const :ref:`dnnl_dims_t` padding_r, :ref:`const_dnnl_primitive_attr_t` attr ); :ref:`dnnl_status_t` DNNL_API :ref:`dnnl_pooling_backward_primitive_desc_create`( :ref:`dnnl_primitive_desc_t`* primitive_desc, :ref:`dnnl_engine_t` engine, :ref:`dnnl_alg_kind_t` alg_kind, :ref:`const_dnnl_memory_desc_t` diff_src_desc, :ref:`const_dnnl_memory_desc_t` diff_dst_desc, const :ref:`dnnl_dims_t` strides, const :ref:`dnnl_dims_t` kernel, const :ref:`dnnl_dims_t` dilation, const :ref:`dnnl_dims_t` padding_l, const :ref:`dnnl_dims_t` padding_r, :ref:`const_dnnl_primitive_desc_t` hint_fwd_pd, :ref:`const_dnnl_primitive_attr_t` attr ); .. _details-group__dnnl__api__pooling: Detailed Documentation ~~~~~~~~~~~~~~~~~~~~~~ A primitive to perform max or average pooling with dilation. .. rubric:: See also: :ref:`Pooling ` in developer guide Global Functions ---------------- .. index:: pair: function; dnnl_pooling_forward_primitive_desc_create .. _doxid-group__dnnl__api__pooling_1ga4921dcd2653e2046ef8de99c354957fe: .. ref-code-block:: cpp :class: doxyrest-title-code-block :ref:`dnnl_status_t` DNNL_API dnnl_pooling_forward_primitive_desc_create( :ref:`dnnl_primitive_desc_t`* primitive_desc, :ref:`dnnl_engine_t` engine, :ref:`dnnl_prop_kind_t` prop_kind, :ref:`dnnl_alg_kind_t` alg_kind, :ref:`const_dnnl_memory_desc_t` src_desc, :ref:`const_dnnl_memory_desc_t` dst_desc, const :ref:`dnnl_dims_t` strides, const :ref:`dnnl_dims_t` kernel, const :ref:`dnnl_dims_t` dilation, const :ref:`dnnl_dims_t` padding_l, const :ref:`dnnl_dims_t` padding_r, :ref:`const_dnnl_primitive_attr_t` attr ) Creates a primitive descriptor for a pooling forward propagation primitive. Arrays ``strides``, ``kernel``, ``dilation``, ``padding_l`` and ``padding_r`` contain values for spatial dimensions only and hence must have the same number of elements as there are spatial dimensions. The order of values is the same as in the tensor: depth (for 3D tensors), height (for 3D and 2D tensors), and width. .. rubric:: Parameters: .. list-table:: :widths: 20 80 * - primitive_desc - Output primitive descriptor. * - engine - Engine to use. * - prop_kind - Propagation kind. Possible values are :ref:`dnnl_forward_training ` and :ref:`dnnl_forward_inference `. * - alg_kind - Pooling algorithm kind: either :ref:`dnnl_pooling_max `, :ref:`dnnl_pooling_avg_include_padding `, or :ref:`dnnl_pooling_avg_exclude_padding `. * - src_desc - Source memory descriptor. * - dst_desc - Destination memory descriptor. * - strides - Array of strides for spatial dimension. * - kernel - Array of kernel spatial dimensions. * - dilation - Array of dilations for spatial dimension. * - padding_l - Array of padding values for low indices for each spatial dimension ``([[front,] top,] left)``. * - padding_r - Array of padding values for high indices for each spatial dimension ``([[back,] bottom,] right)``. Can be NULL in which case padding is considered to be symmetrical. * - attr - Primitive attributes (can be NULL). .. rubric:: Returns: :ref:`dnnl_success ` on success and a status describing the error otherwise. .. index:: pair: function; dnnl_pooling_backward_primitive_desc_create .. _doxid-group__dnnl__api__pooling_1ga0f1637d5ab52a8b784e642d6afac9fec: .. ref-code-block:: cpp :class: doxyrest-title-code-block :ref:`dnnl_status_t` DNNL_API dnnl_pooling_backward_primitive_desc_create( :ref:`dnnl_primitive_desc_t`* primitive_desc, :ref:`dnnl_engine_t` engine, :ref:`dnnl_alg_kind_t` alg_kind, :ref:`const_dnnl_memory_desc_t` diff_src_desc, :ref:`const_dnnl_memory_desc_t` diff_dst_desc, const :ref:`dnnl_dims_t` strides, const :ref:`dnnl_dims_t` kernel, const :ref:`dnnl_dims_t` dilation, const :ref:`dnnl_dims_t` padding_l, const :ref:`dnnl_dims_t` padding_r, :ref:`const_dnnl_primitive_desc_t` hint_fwd_pd, :ref:`const_dnnl_primitive_attr_t` attr ) Creates a primitive descriptor for a pooling backward propagation primitive. Arrays ``strides``, ``kernel``, ``dilation``, ``padding_l`` and ``padding_r`` contain values for spatial dimensions only and hence must have the same number of elements as there are spatial dimensions. The order of values is the same as in the tensor: depth (for 3D tensors), height (for 3D and 2D tensors), and width. .. rubric:: Parameters: .. list-table:: :widths: 20 80 * - primitive_desc - Output primitive descriptor. * - engine - Engine to use. * - alg_kind - Pooling algorithm kind: either :ref:`dnnl_pooling_max `, :ref:`dnnl_pooling_avg_include_padding `, or :ref:`dnnl_pooling_avg_exclude_padding `. * - diff_src_desc - Diff source memory descriptor. * - diff_dst_desc - Diff destination memory descriptor. * - strides - Array of strides for spatial dimension. * - kernel - Array of kernel spatial dimensions. * - dilation - Array of dilations for spatial dimension. * - padding_l - Array of padding values for low indices for each spatial dimension ``([[front,] top,] left)``. * - padding_r - Array of padding values for high indices for each spatial dimension ``([[back,] bottom,] right)``. Can be NULL in which case padding is considered to be symmetrical. * - hint_fwd_pd - Primitive descriptor for a respective forward propagation primitive. * - attr - Primitive attributes (can be NULL). .. rubric:: Returns: :ref:`dnnl_success ` on success and a status describing the error otherwise.