.. index:: pair: struct; dnnl::layer_normalization_backward::primitive_desc .. _doxid-structdnnl_1_1layer__normalization__backward_1_1primitive__desc: struct dnnl::layer_normalization_backward::primitive_desc ========================================================= .. toctree:: :hidden: Overview ~~~~~~~~ Primitive descriptor for a layer normalization backward propagation primitive. :ref:`More...` .. ref-code-block:: cpp :class: doxyrest-overview-code-block #include struct primitive_desc: public :ref:`dnnl::primitive_desc` { // construction :ref:`primitive_desc`(); :ref:`primitive_desc`( const :ref:`engine`& aengine, :ref:`prop_kind` aprop_kind, const :ref:`memory::desc`& diff_src_desc, const :ref:`memory::desc`& diff_dst_desc, const :ref:`memory::desc`& src_desc, const :ref:`memory::desc`& stat_desc, float epsilon, :ref:`normalization_flags` flags, const :ref:`layer_normalization_forward::primitive_desc`& hint_fwd_pd, const :ref:`primitive_attr`& attr = :ref:`default_attr`(), bool allow_empty = false ); :ref:`primitive_desc`( const :ref:`engine`& aengine, :ref:`prop_kind` aprop_kind, const :ref:`memory::desc`& diff_src_desc, const :ref:`memory::desc`& diff_dst_desc, const :ref:`memory::desc`& src_desc, float epsilon, :ref:`normalization_flags` flags, const :ref:`layer_normalization_forward::primitive_desc`& hint_fwd_pd, const :ref:`primitive_attr`& attr = :ref:`default_attr`(), bool allow_empty = false ); :ref:`primitive_desc`( const :ref:`engine`& aengine, :ref:`prop_kind` aprop_kind, const :ref:`memory::desc`& diff_src_desc, const :ref:`memory::desc`& diff_dst_desc, const :ref:`memory::desc`& src_desc, const :ref:`memory::desc`& stat_desc, :ref:`memory::data_type` diff_scale_shift_data_type, :ref:`memory::data_type` scale_shift_data_type, float epsilon, :ref:`normalization_flags` flags, const :ref:`layer_normalization_forward::primitive_desc`& hint_fwd_pd, const :ref:`primitive_attr`& attr = :ref:`default_attr`(), bool allow_empty = false ); :ref:`primitive_desc`( const :ref:`engine`& aengine, :ref:`prop_kind` aprop_kind, const :ref:`memory::desc`& diff_src_desc, const :ref:`memory::desc`& diff_dst_desc, const :ref:`memory::desc`& src_desc, :ref:`memory::data_type` diff_scale_shift_data_type, :ref:`memory::data_type` scale_shift_data_type, float epsilon, :ref:`normalization_flags` flags, const :ref:`layer_normalization_forward::primitive_desc`& hint_fwd_pd, const :ref:`primitive_attr`& attr = :ref:`default_attr`(), bool allow_empty = false ); :ref:`primitive_desc`(:ref:`dnnl_primitive_desc_t` pd); // methods :ref:`memory::desc` :ref:`src_desc`() const; :ref:`memory::desc` :ref:`weights_desc`() const; :ref:`memory::desc` :ref:`dst_desc`() const; :ref:`memory::desc` :ref:`diff_src_desc`() const; :ref:`memory::desc` :ref:`diff_dst_desc`() const; :ref:`memory::desc` :ref:`diff_weights_desc`() const; :ref:`memory::desc` :ref:`mean_desc`() const; :ref:`memory::desc` :ref:`variance_desc`() const; :ref:`memory::desc` :ref:`workspace_desc`() const; :ref:`dnnl::prop_kind` :ref:`get_prop_kind`() const; float :ref:`get_epsilon`() const; :ref:`normalization_flags` :ref:`get_flags`() const; }; Inherited Members ----------------- .. ref-code-block:: cpp :class: doxyrest-overview-inherited-code-block public: // methods :ref:`handle`& :ref:`operator =` (const :ref:`handle`&); :ref:`handle`& :ref:`operator =` (:ref:`handle`&&); void :ref:`reset`(T t, bool weak = false); T :ref:`get`(bool allow_empty = false) const; :ref:`operator T` () const; :ref:`operator bool` () const; bool :ref:`operator ==` (const :ref:`handle`& other) const; bool :ref:`operator !=` (const :ref:`handle`& other) const; :ref:`engine` :ref:`get_engine`() const; const char* :ref:`impl_info_str`() const; :ref:`memory::dim` :ref:`query_s64`(:ref:`query` what) const; :ref:`memory::dims` :ref:`get_strides`() const; :ref:`memory::dims` :ref:`get_dilations`() const; :ref:`memory::dims` :ref:`get_padding_l`() const; :ref:`memory::dims` :ref:`get_padding_r`() const; float :ref:`get_epsilon`() const; template T :ref:`get_flags`() const; :ref:`dnnl::algorithm` :ref:`get_algorithm`() const; float :ref:`get_alpha`() const; float :ref:`get_beta`() const; int :ref:`get_axis`() const; :ref:`memory::dim` :ref:`get_local_size`() const; float :ref:`get_k`() const; float :ref:`get_p`() const; std::vector :ref:`get_factors`() const; :ref:`dnnl::algorithm` :ref:`get_cell_kind`() const; :ref:`dnnl::rnn_direction` :ref:`get_direction`() const; :ref:`dnnl::algorithm` :ref:`get_activation_kind`() const; :ref:`memory::dims` :ref:`get_kernel`() const; :ref:`memory::dim` :ref:`get_group_size`() const; :ref:`dnnl::prop_kind` :ref:`get_prop_kind`() const; :ref:`memory::desc` :ref:`query_md`(:ref:`query` what, int idx = 0) const; :ref:`memory::desc` :ref:`src_desc`(int idx) const; :ref:`memory::desc` :ref:`dst_desc`(int idx) const; :ref:`memory::desc` :ref:`weights_desc`(int idx) const; :ref:`memory::desc` :ref:`diff_src_desc`(int idx) const; :ref:`memory::desc` :ref:`diff_dst_desc`(int idx) const; :ref:`memory::desc` :ref:`diff_weights_desc`(int idx) const; :ref:`memory::desc` :ref:`src_desc`() const; :ref:`memory::desc` :ref:`dst_desc`() const; :ref:`memory::desc` :ref:`weights_desc`() const; :ref:`memory::desc` :ref:`diff_src_desc`() const; :ref:`memory::desc` :ref:`diff_dst_desc`() const; :ref:`memory::desc` :ref:`diff_weights_desc`() const; :ref:`memory::desc` :ref:`workspace_desc`() const; :ref:`memory::desc` :ref:`scratchpad_desc`() const; :ref:`engine` :ref:`scratchpad_engine`() const; :ref:`primitive_attr` :ref:`get_primitive_attr`() const; :ref:`dnnl::primitive::kind` :ref:`get_kind`() const; std::vector :ref:`get_cache_blob_id`() const; bool :ref:`next_impl`(); :ref:`primitive_desc_base`(); :ref:`primitive_desc_base`(); :ref:`primitive_desc_base`(); :ref:`primitive_desc_base`(); .. _details-structdnnl_1_1layer__normalization__backward_1_1primitive__desc: Detailed Documentation ~~~~~~~~~~~~~~~~~~~~~~ Primitive descriptor for a layer normalization backward propagation primitive. Construction ------------ .. index:: pair: function; primitive_desc .. _doxid-structdnnl_1_1layer__normalization__backward_1_1primitive__desc_1a089f50240fc60f36eae68223c7219a60: .. ref-code-block:: cpp :class: doxyrest-title-code-block primitive_desc() Default constructor. Produces an empty object. .. index:: pair: function; primitive_desc .. _doxid-structdnnl_1_1layer__normalization__backward_1_1primitive__desc_1abfd0bb058e9cd71254682343a12925c4: .. ref-code-block:: cpp :class: doxyrest-title-code-block primitive_desc( const :ref:`engine`& aengine, :ref:`prop_kind` aprop_kind, const :ref:`memory::desc`& diff_src_desc, const :ref:`memory::desc`& diff_dst_desc, const :ref:`memory::desc`& src_desc, const :ref:`memory::desc`& stat_desc, float epsilon, :ref:`normalization_flags` flags, const :ref:`layer_normalization_forward::primitive_desc`& hint_fwd_pd, const :ref:`primitive_attr`& attr = :ref:`default_attr`(), bool allow_empty = false ) Constructs a primitive descriptor for a layer normalization backward propagation primitive. .. rubric:: Parameters: .. list-table:: :widths: 20 80 * - aengine - Engine to use. * - aprop_kind - Propagation kind. Possible values are :ref:`dnnl::prop_kind::backward_data ` and :ref:`dnnl::prop_kind::backward ` (diffs for all parameters are computed in this case). * - diff_src_desc - Diff source memory descriptor. * - diff_dst_desc - Diff destination memory descriptor. * - src_desc - Source memory descriptor. * - stat_desc - Statistics memory descriptors. * - epsilon - Layer normalization epsilon parameter. * - flags - Layer normalization flags (:ref:`dnnl::normalization_flags `). * - attr - Primitive attributes to use. Attributes are optional and default to empty attributes. * - hint_fwd_pd - Primitive descriptor for a layer normalization forward propagation primitive. It is used as a hint for deciding which memory format to use. * - allow_empty - A flag signifying whether construction is allowed to fail without throwing an exception. In this case an empty object will be produced. This flag is optional and defaults to false. .. index:: pair: function; primitive_desc .. _doxid-structdnnl_1_1layer__normalization__backward_1_1primitive__desc_1afa2f606edc4db1ba255c22c0d55dd97f: .. ref-code-block:: cpp :class: doxyrest-title-code-block primitive_desc( const :ref:`engine`& aengine, :ref:`prop_kind` aprop_kind, const :ref:`memory::desc`& diff_src_desc, const :ref:`memory::desc`& diff_dst_desc, const :ref:`memory::desc`& src_desc, float epsilon, :ref:`normalization_flags` flags, const :ref:`layer_normalization_forward::primitive_desc`& hint_fwd_pd, const :ref:`primitive_attr`& attr = :ref:`default_attr`(), bool allow_empty = false ) Constructs a primitive descriptor for a layer normalization backward propagation primitive. .. rubric:: Parameters: .. list-table:: :widths: 20 80 * - aengine - Engine to use. * - aprop_kind - Propagation kind. Possible values are :ref:`dnnl::prop_kind::backward_data ` and :ref:`dnnl::prop_kind::backward ` (diffs for all parameters are computed in this case). * - diff_src_desc - Diff source memory descriptor. * - diff_dst_desc - Diff destination memory descriptor. * - src_desc - Source memory descriptor. * - epsilon - Layer normalization epsilon parameter. * - flags - Layer normalization flags (:ref:`dnnl::normalization_flags `). * - attr - Primitive attributes to use. Attributes are optional and default to empty attributes. * - hint_fwd_pd - Primitive descriptor for a layer normalization forward propagation primitive. It is used as a hint for deciding which memory format to use. * - allow_empty - A flag signifying whether construction is allowed to fail without throwing an exception. In this case an empty object will be produced. This flag is optional and defaults to false. .. index:: pair: function; primitive_desc .. _doxid-structdnnl_1_1layer__normalization__backward_1_1primitive__desc_1ae5d5cfa7faa72b1a6276317d9d6ab42d: .. ref-code-block:: cpp :class: doxyrest-title-code-block primitive_desc( const :ref:`engine`& aengine, :ref:`prop_kind` aprop_kind, const :ref:`memory::desc`& diff_src_desc, const :ref:`memory::desc`& diff_dst_desc, const :ref:`memory::desc`& src_desc, const :ref:`memory::desc`& stat_desc, :ref:`memory::data_type` diff_scale_shift_data_type, :ref:`memory::data_type` scale_shift_data_type, float epsilon, :ref:`normalization_flags` flags, const :ref:`layer_normalization_forward::primitive_desc`& hint_fwd_pd, const :ref:`primitive_attr`& attr = :ref:`default_attr`(), bool allow_empty = false ) Constructs a primitive descriptor for a layer normalization backward propagation primitive with a user-provided data type for the scale and shift memory objects. .. rubric:: Parameters: .. list-table:: :widths: 20 80 * - aengine - Engine to use. * - aprop_kind - Propagation kind. Possible values are :ref:`dnnl::prop_kind::backward_data ` and :ref:`dnnl::prop_kind::backward ` (diffs for all parameters are computed in this case). * - diff_src_desc - Diff source memory descriptor. * - diff_dst_desc - Diff destination memory descriptor. * - src_desc - Source memory descriptor. * - stat_desc - Statistics memory descriptors. * - diff_scale_shift_data_type - Data type of diff scale and shift memory. If neither scale nor shift flag are specified the parameter is ignored. * - scale_shift_data_type - Data type of scale and shift memory. If neither scale nor shift flag are specified the parameter is ignored. * - epsilon - Layer normalization epsilon parameter. * - flags - Layer normalization flags (:ref:`dnnl::normalization_flags `). * - attr - Primitive attributes to use. Attributes are optional and default to empty attributes. * - hint_fwd_pd - Primitive descriptor for a layer normalization forward propagation primitive. It is used as a hint for deciding which memory format to use. * - allow_empty - A flag signifying whether construction is allowed to fail without throwing an exception. In this case an empty object will be produced. This flag is optional and defaults to false. .. index:: pair: function; primitive_desc .. _doxid-structdnnl_1_1layer__normalization__backward_1_1primitive__desc_1a21b1c873eeb19ea5eb3a9f3601c93d4e: .. ref-code-block:: cpp :class: doxyrest-title-code-block primitive_desc( const :ref:`engine`& aengine, :ref:`prop_kind` aprop_kind, const :ref:`memory::desc`& diff_src_desc, const :ref:`memory::desc`& diff_dst_desc, const :ref:`memory::desc`& src_desc, :ref:`memory::data_type` diff_scale_shift_data_type, :ref:`memory::data_type` scale_shift_data_type, float epsilon, :ref:`normalization_flags` flags, const :ref:`layer_normalization_forward::primitive_desc`& hint_fwd_pd, const :ref:`primitive_attr`& attr = :ref:`default_attr`(), bool allow_empty = false ) Constructs a primitive descriptor for a layer normalization backward propagation primitive with a user-provided data type for the scale and shift memory objects. .. rubric:: Parameters: .. list-table:: :widths: 20 80 * - aengine - Engine to use. * - aprop_kind - Propagation kind. Possible values are :ref:`dnnl::prop_kind::backward_data ` and :ref:`dnnl::prop_kind::backward ` (diffs for all parameters are computed in this case). * - diff_src_desc - Diff source memory descriptor. * - diff_dst_desc - Diff destination memory descriptor. * - src_desc - Source memory descriptor. * - diff_scale_shift_data_type - Data type of diff scale and shift memory. If neither scale nor shift flag are specified the parameter is ignored. * - scale_shift_data_type - Data type of scale and shift memory. If neither scale nor shift flag are specified the parameter is ignored. * - epsilon - Layer normalization epsilon parameter. * - flags - Layer normalization flags (:ref:`dnnl::normalization_flags `). * - attr - Primitive attributes to use. Attributes are optional and default to empty attributes. * - hint_fwd_pd - Primitive descriptor for a layer normalization forward propagation primitive. It is used as a hint for deciding which memory format to use. * - allow_empty - A flag signifying whether construction is allowed to fail without throwing an exception. In this case an empty object will be produced. This flag is optional and defaults to false. .. index:: pair: function; primitive_desc .. _doxid-structdnnl_1_1layer__normalization__backward_1_1primitive__desc_1a55f851d3f6eef0a9612f21380fddf016: .. ref-code-block:: cpp :class: doxyrest-title-code-block primitive_desc(:ref:`dnnl_primitive_desc_t` pd) Constructs a primitive descriptor for a layer normalization backward propagation primitive from a C API primitive descriptor that must have a matching kind. .. rubric:: Parameters: .. list-table:: :widths: 20 80 * - pd - C API primitive descriptor for a layer normalization backward propagation primitive. Methods ------- .. index:: pair: function; src_desc .. _doxid-structdnnl_1_1layer__normalization__backward_1_1primitive__desc_1ae18d68c7b8ed354031031146b9c9b396: .. ref-code-block:: cpp :class: doxyrest-title-code-block :ref:`memory::desc` src_desc() const Returns a source memory descriptor. .. rubric:: Returns: Source memory descriptor. A zero memory descriptor if the primitive does not have a source parameter. .. index:: pair: function; weights_desc .. _doxid-structdnnl_1_1layer__normalization__backward_1_1primitive__desc_1a9d1aca510d293af15665f20c5f8250f2: .. ref-code-block:: cpp :class: doxyrest-title-code-block :ref:`memory::desc` weights_desc() const Returns a weights memory descriptor. .. rubric:: Returns: Weights memory descriptor. A zero memory descriptor if the primitive does not have a weights parameter. .. index:: pair: function; dst_desc .. _doxid-structdnnl_1_1layer__normalization__backward_1_1primitive__desc_1a7161632174cf25ba1095fb349c89abee: .. ref-code-block:: cpp :class: doxyrest-title-code-block :ref:`memory::desc` dst_desc() const Returns a destination memory descriptor. .. rubric:: Returns: Destination memory descriptor. A zero memory descriptor if the primitive does not have a destination parameter. .. index:: pair: function; diff_src_desc .. _doxid-structdnnl_1_1layer__normalization__backward_1_1primitive__desc_1a38933c147bf1f8ab11ce77737f4a7e3a: .. ref-code-block:: cpp :class: doxyrest-title-code-block :ref:`memory::desc` diff_src_desc() const Returns a diff source memory descriptor. .. rubric:: Returns: Diff source memory descriptor. A zero memory descriptor if the primitive does not have a diff source memory with. .. index:: pair: function; diff_dst_desc .. _doxid-structdnnl_1_1layer__normalization__backward_1_1primitive__desc_1a676cc7c7737c4ae08f340747033fb6c0: .. ref-code-block:: cpp :class: doxyrest-title-code-block :ref:`memory::desc` diff_dst_desc() const Returns a diff destination memory descriptor. .. rubric:: Returns: Diff destination memory descriptor. A zero memory descriptor if the primitive does not have a diff destination parameter. .. index:: pair: function; diff_weights_desc .. _doxid-structdnnl_1_1layer__normalization__backward_1_1primitive__desc_1aab2ef19d90df6c0334cbb4031d2ecf38: .. ref-code-block:: cpp :class: doxyrest-title-code-block :ref:`memory::desc` diff_weights_desc() const Returns a diff weights memory descriptor. .. rubric:: Returns: Diff weights memory descriptor. A zero memory descriptor if the primitive does not have a diff weights parameter. .. index:: pair: function; mean_desc .. _doxid-structdnnl_1_1layer__normalization__backward_1_1primitive__desc_1a3942862c9c754407d4dd2cc09e34c6b3: .. ref-code-block:: cpp :class: doxyrest-title-code-block :ref:`memory::desc` mean_desc() const Returns memory descriptor for mean. .. rubric:: Returns: Memory descriptor for mean. .. index:: pair: function; variance_desc .. _doxid-structdnnl_1_1layer__normalization__backward_1_1primitive__desc_1a83855eaf5a4b1f9cf99f82db527bef16: .. ref-code-block:: cpp :class: doxyrest-title-code-block :ref:`memory::desc` variance_desc() const Returns memory descriptor for variance. .. rubric:: Returns: Memory descriptor for variance. .. index:: pair: function; workspace_desc .. _doxid-structdnnl_1_1layer__normalization__backward_1_1primitive__desc_1a4a859f92c4cc99b57510b6135eff5e8e: .. ref-code-block:: cpp :class: doxyrest-title-code-block :ref:`memory::desc` workspace_desc() const Returns the workspace memory descriptor. .. rubric:: Returns: Workspace memory descriptor. A zero memory descriptor if the primitive does not require workspace parameter. .. index:: pair: function; get_prop_kind .. _doxid-structdnnl_1_1layer__normalization__backward_1_1primitive__desc_1adea19e3f3b4f37c869ab2b02f120e06f: .. ref-code-block:: cpp :class: doxyrest-title-code-block :ref:`dnnl::prop_kind` get_prop_kind() const Returns a propagation kind. .. rubric:: Returns: A propagation kind. :ref:`dnnl::prop_kind::undef ` if the primitive does not have a propagation parameter. .. index:: pair: function; get_epsilon .. _doxid-structdnnl_1_1layer__normalization__backward_1_1primitive__desc_1ae9ac76247dc7dc6466fb31a877f64bbd: .. ref-code-block:: cpp :class: doxyrest-title-code-block float get_epsilon() const Returns an epsilon. .. rubric:: Returns: An epsilon. Zero if the primitive does not have an epsilon parameter. .. index:: pair: function; get_flags .. _doxid-structdnnl_1_1layer__normalization__backward_1_1primitive__desc_1a752942ab7c8e1dff17038aa85a57cf1e: .. ref-code-block:: cpp :class: doxyrest-title-code-block :ref:`normalization_flags` get_flags() const Returns normalization flags. .. rubric:: Returns: Normalization flags.