.. index:: pair: group; Reduction .. _doxid-group__dnnl__api__reduction: Reduction ========= .. toctree:: :hidden: struct_dnnl_reduction_desc_t.rst struct_dnnl_reduction.rst Overview ~~~~~~~~ A primitive to compute reduction operation on data tensor using min, max, mul, sum, mean and norm_lp operations. :ref:`More...` .. ref-code-block:: cpp :class: doxyrest-overview-code-block // structs struct :ref:`dnnl_reduction_desc_t`; struct :ref:`dnnl::reduction`; // global functions :ref:`dnnl_status_t` DNNL_API :ref:`dnnl_reduction_desc_init`( :ref:`dnnl_reduction_desc_t`* desc, :ref:`dnnl_alg_kind_t` alg_kind, const :ref:`dnnl_memory_desc_t`* src_desc, const :ref:`dnnl_memory_desc_t`* dst_desc, float p, float eps ); .. _details-group__dnnl__api__reduction: Detailed Documentation ~~~~~~~~~~~~~~~~~~~~~~ A primitive to compute reduction operation on data tensor using min, max, mul, sum, mean and norm_lp operations. .. rubric:: See also: :ref:`Reduction ` in developer guide Global Functions ---------------- .. index:: pair: function; dnnl_reduction_desc_init .. _doxid-group__dnnl__api__reduction_1ga507b07a09447e911f68d11aad0fecdde: .. ref-code-block:: cpp :class: doxyrest-title-code-block :ref:`dnnl_status_t` DNNL_API dnnl_reduction_desc_init( :ref:`dnnl_reduction_desc_t`* desc, :ref:`dnnl_alg_kind_t` alg_kind, const :ref:`dnnl_memory_desc_t`* src_desc, const :ref:`dnnl_memory_desc_t`* dst_desc, float p, float eps ) Initializes a descriptor for a reduction primitive. .. note:: Destination memory descriptor is allowed to be initialized with :ref:`dnnl_format_tag_any ` or with format_kind set to :ref:`dnnl_format_kind_any `. .. rubric:: Parameters: .. list-table:: :widths: 20 80 * - desc - Output descriptor for a reduction primitive. * - alg_kind - reduction algorithm kind. Possible values: :ref:`dnnl_reduction_max `, :ref:`dnnl_reduction_min `, :ref:`dnnl_reduction_sum `, :ref:`dnnl_reduction_mul `, :ref:`dnnl_reduction_mean `, :ref:`dnnl_reduction_norm_lp_max `, :ref:`dnnl_reduction_norm_lp_sum `, :ref:`dnnl_reduction_norm_lp_power_p_max `, :ref:`dnnl_reduction_norm_lp_power_p_sum `. * - p - Algorithm specific parameter. * - eps - Algorithm specific parameter. * - src_desc - Source memory descriptor. * - dst_desc - Destination memory descriptor. .. rubric:: Returns: :ref:`dnnl_success ` on success and a status describing the error otherwise.