struct dnnl::eltwise_backward::primitive_desc¶
Overview¶
Primitive descriptor for eltwise backward propagation. More…
#include <dnnl.hpp> struct primitive_desc: public dnnl::primitive_desc { // construction primitive_desc(); primitive_desc( const engine& aengine, algorithm aalgorithm, const memory::desc& diff_src_desc, const memory::desc& diff_dst_desc, const memory::desc& data_desc, const eltwise_forward::primitive_desc& hint_fwd_pd, const primitive_attr& attr = default_attr(), bool allow_empty = false ); primitive_desc( const engine& aengine, algorithm aalgorithm, const memory::desc& diff_src_desc, const memory::desc& diff_dst_desc, const memory::desc& data_desc, float alpha, const eltwise_forward::primitive_desc& hint_fwd_pd, const primitive_attr& attr = default_attr(), bool allow_empty = false ); primitive_desc( const engine& aengine, algorithm aalgorithm, const memory::desc& diff_src_desc, const memory::desc& diff_dst_desc, const memory::desc& data_desc, float alpha, float beta, const eltwise_forward::primitive_desc& hint_fwd_pd, const primitive_attr& attr = default_attr(), bool allow_empty = false ); primitive_desc(dnnl_primitive_desc_t pd); // methods memory::desc src_desc() const; memory::desc diff_src_desc() const; memory::desc diff_dst_desc() const; dnnl::algorithm get_algorithm() const; dnnl::prop_kind get_prop_kind() const; float get_alpha() const; float get_beta() const; };
Inherited Members¶
public: // methods handle<T, traits>& operator = (const handle<T, traits>&); handle<T, traits>& operator = (handle<T, traits>&&); void reset(T t, bool weak = false); T get(bool allow_empty = false) const; operator T () const; operator bool () const; bool operator == (const handle<T, traits>& other) const; bool operator != (const handle& other) const; engine get_engine() const; const char* impl_info_str() const; memory::dim query_s64(query what) const; memory::dims get_strides() const; memory::dims get_dilations() const; memory::dims get_padding_l() const; memory::dims get_padding_r() const; float get_epsilon() const; template <typename T = unsigned> T get_flags() const; dnnl::algorithm get_algorithm() const; float get_alpha() const; float get_beta() const; int get_axis() const; memory::dim get_local_size() const; float get_k() const; float get_p() const; std::vector<float> get_factors() const; dnnl::algorithm get_cell_kind() const; dnnl::rnn_direction get_direction() const; dnnl::algorithm get_activation_kind() const; memory::dims get_kernel() const; memory::dim get_group_size() const; dnnl::prop_kind get_prop_kind() const; memory::desc query_md(query what, int idx = 0) const; memory::desc src_desc(int idx) const; memory::desc dst_desc(int idx) const; memory::desc weights_desc(int idx) const; memory::desc diff_src_desc(int idx) const; memory::desc diff_dst_desc(int idx) const; memory::desc diff_weights_desc(int idx) const; memory::desc src_desc() const; memory::desc dst_desc() const; memory::desc weights_desc() const; memory::desc diff_src_desc() const; memory::desc diff_dst_desc() const; memory::desc diff_weights_desc() const; memory::desc workspace_desc() const; memory::desc scratchpad_desc() const; engine scratchpad_engine() const; primitive_attr get_primitive_attr() const; dnnl::primitive::kind get_kind() const; std::vector<uint8_t> get_cache_blob_id() const; bool next_impl(); primitive_desc_base(); primitive_desc_base(); primitive_desc_base(); primitive_desc_base();
Detailed Documentation¶
Primitive descriptor for eltwise backward propagation.
Construction¶
primitive_desc()
Default constructor. Produces an empty object.
primitive_desc( const engine& aengine, algorithm aalgorithm, const memory::desc& diff_src_desc, const memory::desc& diff_dst_desc, const memory::desc& data_desc, const eltwise_forward::primitive_desc& hint_fwd_pd, const primitive_attr& attr = default_attr(), bool allow_empty = false )
Constructs a primitive descriptor for an elementwise backward propagation primitive with an alpha parameter.
Parameters:
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 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. |
primitive_desc( const engine& aengine, algorithm aalgorithm, const memory::desc& diff_src_desc, const memory::desc& diff_dst_desc, const memory::desc& data_desc, float alpha, const eltwise_forward::primitive_desc& hint_fwd_pd, const primitive_attr& attr = default_attr(), bool allow_empty = false )
Constructs a primitive descriptor for an elementwise backward propagation primitive with an alpha parameter.
Parameters:
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 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. |
primitive_desc( const engine& aengine, algorithm aalgorithm, const memory::desc& diff_src_desc, const memory::desc& diff_dst_desc, const memory::desc& data_desc, float alpha, float beta, const eltwise_forward::primitive_desc& hint_fwd_pd, const primitive_attr& attr = default_attr(), bool allow_empty = false )
Constructs a primitive descriptor for an elementwise backward propagation primitive with an alpha and beta parameters.
Parameters:
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 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. |
primitive_desc(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.
Parameters:
pd |
C API primitive descriptor for an eltwise backward propagation primitive. |
Methods¶
memory::desc src_desc() const
Returns a source memory descriptor.
Returns:
Source memory descriptor.
A zero memory descriptor if the primitive does not have a source parameter.
memory::desc diff_src_desc() const
Returns a diff source memory descriptor.
Returns:
Diff source memory descriptor.
A zero memory descriptor if the primitive does not have a diff source memory with.
memory::desc diff_dst_desc() const
Returns a diff destination memory descriptor.
Returns:
Diff destination memory descriptor.
A zero memory descriptor if the primitive does not have a diff destination parameter.
dnnl::algorithm get_algorithm() const
Returns an algorithm kind.
Returns:
An algorithm kind.
dnnl::algorithm::undef if the primitive does not have an algorithm parameter.
dnnl::prop_kind get_prop_kind() const
Returns a propagation kind.
Returns:
A propagation kind.
dnnl::prop_kind::undef if the primitive does not have a propagation parameter.
float get_alpha() const
Returns an alpha.
Returns:
An alpha.
Zero if the primitive does not have an alpha parameter.
float get_beta() const
Returns a beta.
Returns:
A beta.
Zero if the primitive does not have a beta parameter.