.. index:: pair: group; Softmax .. _doxid-group__dnnl__api__softmax: Softmax ======= .. toctree:: :hidden: struct_dnnl_softmax_backward.rst struct_dnnl_softmax_forward.rst Overview ~~~~~~~~ A primitive to perform softmax. :ref:`More...` .. ref-code-block:: cpp :class: doxyrest-overview-code-block // structs struct :ref:`dnnl::softmax_backward`; struct :ref:`dnnl::softmax_forward`; // global functions :ref:`dnnl_status_t` DNNL_API :ref:`dnnl_softmax_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, int softmax_axis, :ref:`const_dnnl_primitive_attr_t` attr ); :ref:`dnnl_status_t` DNNL_API :ref:`dnnl_softmax_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, :ref:`const_dnnl_memory_desc_t` dst_desc, int softmax_axis, :ref:`const_dnnl_primitive_desc_t` hint_fwd_pd, :ref:`const_dnnl_primitive_attr_t` attr ); .. _details-group__dnnl__api__softmax: Detailed Documentation ~~~~~~~~~~~~~~~~~~~~~~ A primitive to perform softmax. .. rubric:: See also: :ref:`Softmax ` in developer guide Global Functions ---------------- .. index:: pair: function; dnnl_softmax_forward_primitive_desc_create .. _doxid-group__dnnl__api__softmax_1ga4ca3adbc99470d1f4111466dac4d1c76: .. ref-code-block:: cpp :class: doxyrest-title-code-block :ref:`dnnl_status_t` DNNL_API dnnl_softmax_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, int softmax_axis, :ref:`const_dnnl_primitive_attr_t` attr ) Creates a primitive descriptor for a softmax forward propagation primitive. .. 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 - Softmax algorithm kind: either :ref:`dnnl_softmax_accurate `, or :ref:`dnnl_softmax_log `. * - src_desc - Source memory descriptor. * - dst_desc - Destination memory descriptor. * - softmax_axis - Axis over which softmax is computed. * - attr - Primitive attributes (can be NULL). .. rubric:: Returns: :ref:`dnnl_success ` on success and a status describing the error otherwise. .. index:: pair: function; dnnl_softmax_backward_primitive_desc_create .. _doxid-group__dnnl__api__softmax_1ga99a72d524ea876adee57dbd91408a83c: .. ref-code-block:: cpp :class: doxyrest-title-code-block :ref:`dnnl_status_t` DNNL_API dnnl_softmax_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, :ref:`const_dnnl_memory_desc_t` dst_desc, int softmax_axis, :ref:`const_dnnl_primitive_desc_t` hint_fwd_pd, :ref:`const_dnnl_primitive_attr_t` attr ) Creates a primitive descriptor for a softmax backward propagation primitive. .. rubric:: Parameters: .. list-table:: :widths: 20 80 * - primitive_desc - Output primitive descriptor. * - engine - Engine to use. * - alg_kind - Softmax algorithm kind: either :ref:`dnnl_softmax_accurate `, or :ref:`dnnl_softmax_log `. * - diff_src_desc - Diff source memory descriptor. * - diff_dst_desc - Diff destination memory descriptor. * - dst_desc - Destination memory descriptor. * - softmax_axis - Axis over which softmax is computed. * - 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.