.. index:: pair: struct; dnnl::eltwise_backward::primitive_desc .. _doxid-structdnnl_1_1eltwise__backward_1_1primitive__desc: struct dnnl::eltwise_backward::primitive_desc ============================================= .. toctree:: :hidden: Overview ~~~~~~~~ Primitive descriptor for eltwise backward propagation. :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:`algorithm` aalgorithm, const :ref:`memory::desc`& diff_src_desc, const :ref:`memory::desc`& diff_dst_desc, const :ref:`memory::desc`& data_desc, const :ref:`eltwise_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:`algorithm` aalgorithm, const :ref:`memory::desc`& diff_src_desc, const :ref:`memory::desc`& diff_dst_desc, const :ref:`memory::desc`& data_desc, float alpha, const :ref:`eltwise_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:`algorithm` aalgorithm, const :ref:`memory::desc`& diff_src_desc, const :ref:`memory::desc`& diff_dst_desc, const :ref:`memory::desc`& data_desc, float alpha, float beta, const :ref:`eltwise_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:`diff_src_desc`() const; :ref:`memory::desc` :ref:`diff_dst_desc`() const; :ref:`dnnl::algorithm` :ref:`get_algorithm`() const; :ref:`dnnl::prop_kind` :ref:`get_prop_kind`() const; float :ref:`get_alpha`() const; float :ref:`get_beta`() 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_1eltwise__backward_1_1primitive__desc: Detailed Documentation ~~~~~~~~~~~~~~~~~~~~~~ Primitive descriptor for eltwise backward propagation. Construction ------------ .. index:: pair: function; primitive_desc .. _doxid-structdnnl_1_1eltwise__backward_1_1primitive__desc_1a656a7d9aece3a8b0c0970b64579ce544: .. 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_1eltwise__backward_1_1primitive__desc_1a233814784e7f645dc1b271cf8c0eb089: .. ref-code-block:: cpp :class: doxyrest-title-code-block primitive_desc( const :ref:`engine`& aengine, :ref:`algorithm` aalgorithm, const :ref:`memory::desc`& diff_src_desc, const :ref:`memory::desc`& diff_dst_desc, const :ref:`memory::desc`& data_desc, const :ref:`eltwise_forward::primitive_desc`& hint_fwd_pd, const :ref:`primitive_attr`& attr = :ref:`default_attr`(), bool allow_empty = false ) Constructs a primitive descriptor for an elementwise backward propagation primitive with an alpha parameter. .. rubric:: Parameters: .. list-table:: :widths: 20 80 * - aengine - Engine to use. * - aalgorithm - Elementwise algorithm kind. * - diff_src_desc - Diff source memory descriptor. * - diff_dst_desc - Diff destination memory descriptor. * - data_desc - Destination memory descriptor if one of the "use_dst_for_bwd" algorithms are used (such as :ref:`dnnl_eltwise_relu_use_dst_for_bwd `), source memory descriptor otherwise. * - hint_fwd_pd - Primitive descriptor for an elementwise forward propagation primitive. It is used as a hint for deciding which memory format to use. * - attr - Primitive attributes to use. Attributes are optional and default to empty attributes. * - 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_1eltwise__backward_1_1primitive__desc_1ae97948311f970d65494a39341694f33a: .. ref-code-block:: cpp :class: doxyrest-title-code-block primitive_desc( const :ref:`engine`& aengine, :ref:`algorithm` aalgorithm, const :ref:`memory::desc`& diff_src_desc, const :ref:`memory::desc`& diff_dst_desc, const :ref:`memory::desc`& data_desc, float alpha, const :ref:`eltwise_forward::primitive_desc`& hint_fwd_pd, const :ref:`primitive_attr`& attr = :ref:`default_attr`(), bool allow_empty = false ) Constructs a primitive descriptor for an elementwise backward propagation primitive with an alpha parameter. .. rubric:: Parameters: .. list-table:: :widths: 20 80 * - aengine - Engine to use. * - aalgorithm - Elementwise algorithm kind. * - diff_src_desc - Diff source memory descriptor. * - diff_dst_desc - Diff destination memory descriptor. * - data_desc - Destination memory descriptor if one of the "use_dst_for_bwd" algorithms are used (such as :ref:`dnnl_eltwise_relu_use_dst_for_bwd `), source memory descriptor otherwise. * - alpha - The alpha parameter for the elementwise operation. Specific meaning depends on the algorithm. * - hint_fwd_pd - Primitive descriptor for an elementwise forward propagation primitive. It is used as a hint for deciding which memory format to use. * - attr - Primitive attributes to use. Attributes are optional and default to empty attributes. * - 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_1eltwise__backward_1_1primitive__desc_1a3fb5e7cccc31ef35524269b04e346fa6: .. ref-code-block:: cpp :class: doxyrest-title-code-block primitive_desc( const :ref:`engine`& aengine, :ref:`algorithm` aalgorithm, const :ref:`memory::desc`& diff_src_desc, const :ref:`memory::desc`& diff_dst_desc, const :ref:`memory::desc`& data_desc, float alpha, float beta, const :ref:`eltwise_forward::primitive_desc`& hint_fwd_pd, const :ref:`primitive_attr`& attr = :ref:`default_attr`(), bool allow_empty = false ) Constructs a primitive descriptor for an elementwise backward propagation primitive with an alpha and beta parameters. .. rubric:: Parameters: .. list-table:: :widths: 20 80 * - aengine - Engine to use. * - aalgorithm - Elementwise algorithm kind. * - diff_src_desc - Diff source memory descriptor. * - diff_dst_desc - Diff destination memory descriptor. * - data_desc - Destination memory descriptor if one of the "use_dst_for_bwd" algorithms are used (such as :ref:`dnnl_eltwise_relu_use_dst_for_bwd `), source memory descriptor otherwise. * - alpha - The alpha parameter for the elementwise operation. Specific meaning depends on the algorithm. * - beta - The beta parameter for the elementwise operation. Specific meaning depends on the algorithm. * - hint_fwd_pd - Primitive descriptor for an elementwise forward propagation primitive. It is used as a hint for deciding which memory format to use. * - attr - Primitive attributes to use. Attributes are optional and default to empty attributes. * - 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_1eltwise__backward_1_1primitive__desc_1aeadf274f41a2aeaafb63f5b0708d86e7: .. ref-code-block:: cpp :class: doxyrest-title-code-block primitive_desc(:ref:`dnnl_primitive_desc_t` pd) Constructs a primitive descriptor for an eltwise 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 an eltwise backward propagation primitive. Methods ------- .. index:: pair: function; src_desc .. _doxid-structdnnl_1_1eltwise__backward_1_1primitive__desc_1a8d78475cfeda855b23b0e9335aacacc1: .. 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; diff_src_desc .. _doxid-structdnnl_1_1eltwise__backward_1_1primitive__desc_1a090cc653f9ea9b8186078b764d2ec033: .. 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_1eltwise__backward_1_1primitive__desc_1acaf67e02a1a65bd0f5480d98f520ec73: .. 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; get_algorithm .. _doxid-structdnnl_1_1eltwise__backward_1_1primitive__desc_1ab1f69871fda9369c99b8a3d6a1bea11f: .. ref-code-block:: cpp :class: doxyrest-title-code-block :ref:`dnnl::algorithm` get_algorithm() const Returns an algorithm kind. .. rubric:: Returns: An algorithm kind. :ref:`dnnl::algorithm::undef ` if the primitive does not have an algorithm parameter. .. index:: pair: function; get_prop_kind .. _doxid-structdnnl_1_1eltwise__backward_1_1primitive__desc_1a35fb93863b84d27473942b79fc07d330: .. 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_alpha .. _doxid-structdnnl_1_1eltwise__backward_1_1primitive__desc_1a96ea510b8a8c0e1bae690a1330204944: .. ref-code-block:: cpp :class: doxyrest-title-code-block float get_alpha() const Returns an alpha. .. rubric:: Returns: An alpha. Zero if the primitive does not have an alpha parameter. .. index:: pair: function; get_beta .. _doxid-structdnnl_1_1eltwise__backward_1_1primitive__desc_1ac974fd4350f48f19898d9070973f2a22: .. ref-code-block:: cpp :class: doxyrest-title-code-block float get_beta() const Returns a beta. .. rubric:: Returns: A beta. Zero if the primitive does not have a beta parameter.