Visible to Intel only — GUID: GUID-51F50907-7A5B-48EC-9A08-9CFF6E4A196D
Visible to Intel only — GUID: GUID-51F50907-7A5B-48EC-9A08-9CFF6E4A196D
struct dnnl::lstm_backward::primitive_desc
Overview
Primitive descriptor for an LSTM backward propagation primitive. More…
#include <dnnl.hpp>
struct primitive_desc: public dnnl::rnn_primitive_desc_base
{
// construction
primitive_desc();
primitive_desc(
const engine& aengine,
prop_kind aprop_kind,
rnn_direction direction,
const memory::desc& src_layer_desc,
const memory::desc& src_iter_desc,
const memory::desc& src_iter_c_desc,
const memory::desc& weights_layer_desc,
const memory::desc& weights_iter_desc,
const memory::desc& weights_peephole_desc,
const memory::desc& weights_projection_desc,
const memory::desc& bias_desc,
const memory::desc& dst_layer_desc,
const memory::desc& dst_iter_desc,
const memory::desc& dst_iter_c_desc,
const memory::desc& diff_src_layer_desc,
const memory::desc& diff_src_iter_desc,
const memory::desc& diff_src_iter_c_desc,
const memory::desc& diff_weights_layer_desc,
const memory::desc& diff_weights_iter_desc,
const memory::desc& diff_weights_peephole_desc,
const memory::desc& diff_weights_projection_desc,
const memory::desc& diff_bias_desc,
const memory::desc& diff_dst_layer_desc,
const memory::desc& diff_dst_iter_desc,
const memory::desc& diff_dst_iter_c_desc,
const lstm_forward::primitive_desc& hint_fwd_pd,
const primitive_attr& attr = default_attr(),
bool allow_empty = false
);
primitive_desc(
const engine& aengine,
prop_kind aprop_kind,
rnn_direction direction,
const memory::desc& src_layer_desc,
const memory::desc& src_iter_desc,
const memory::desc& src_iter_c_desc,
const memory::desc& weights_layer_desc,
const memory::desc& weights_iter_desc,
const memory::desc& weights_peephole_desc,
const memory::desc& bias_desc,
const memory::desc& dst_layer_desc,
const memory::desc& dst_iter_desc,
const memory::desc& dst_iter_c_desc,
const memory::desc& diff_src_layer_desc,
const memory::desc& diff_src_iter_desc,
const memory::desc& diff_src_iter_c_desc,
const memory::desc& diff_weights_layer_desc,
const memory::desc& diff_weights_iter_desc,
const memory::desc& diff_weights_peephole_desc,
const memory::desc& diff_bias_desc,
const memory::desc& diff_dst_layer_desc,
const memory::desc& diff_dst_iter_desc,
const memory::desc& diff_dst_iter_c_desc,
const lstm_forward::primitive_desc& hint_fwd_pd,
const primitive_attr& attr = default_attr(),
bool allow_empty = false
);
primitive_desc(
const engine& aengine,
prop_kind aprop_kind,
rnn_direction direction,
const memory::desc& src_layer_desc,
const memory::desc& src_iter_desc,
const memory::desc& src_iter_c_desc,
const memory::desc& weights_layer_desc,
const memory::desc& weights_iter_desc,
const memory::desc& bias_desc,
const memory::desc& dst_layer_desc,
const memory::desc& dst_iter_desc,
const memory::desc& dst_iter_c_desc,
const memory::desc& diff_src_layer_desc,
const memory::desc& diff_src_iter_desc,
const memory::desc& diff_src_iter_c_desc,
const memory::desc& diff_weights_layer_desc,
const memory::desc& diff_weights_iter_desc,
const memory::desc& diff_bias_desc,
const memory::desc& diff_dst_layer_desc,
const memory::desc& diff_dst_iter_desc,
const memory::desc& diff_dst_iter_c_desc,
const lstm_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_layer_desc() const;
memory::desc src_iter_desc() const;
memory::desc src_iter_c_desc() const;
memory::desc weights_layer_desc() const;
memory::desc weights_iter_desc() const;
memory::desc weights_peephole_desc() const;
memory::desc weights_projection_desc() const;
memory::desc bias_desc() const;
memory::desc dst_layer_desc() const;
memory::desc dst_iter_desc() const;
memory::desc dst_iter_c_desc() const;
memory::desc workspace_desc() const;
memory::desc diff_src_layer_desc() const;
memory::desc diff_src_iter_desc() const;
memory::desc diff_src_iter_c_desc() const;
memory::desc diff_weights_layer_desc() const;
memory::desc diff_weights_iter_desc() const;
memory::desc diff_weights_peephole_desc() const;
memory::desc diff_weights_projection_desc() const;
memory::desc diff_bias_desc() const;
memory::desc diff_dst_layer_desc() const;
memory::desc diff_dst_iter_desc() const;
memory::desc diff_dst_iter_c_desc() const;
algorithm get_cell_kind() const;
prop_kind get_prop_kind() const;
rnn_direction get_direction() 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();
memory::desc src_layer_desc() const;
memory::desc augru_attention_desc() const;
memory::desc src_iter_desc() const;
memory::desc src_iter_c_desc() const;
memory::desc weights_layer_desc() const;
memory::desc weights_iter_desc() const;
memory::desc weights_peephole_desc() const;
memory::desc weights_projection_desc() const;
memory::desc bias_desc() const;
memory::desc dst_layer_desc() const;
memory::desc dst_iter_desc() const;
memory::desc dst_iter_c_desc() const;
memory::desc diff_src_layer_desc() const;
memory::desc diff_augru_attention_desc() const;
memory::desc diff_src_iter_desc() const;
memory::desc diff_src_iter_c_desc() const;
memory::desc diff_weights_layer_desc() const;
memory::desc diff_weights_iter_desc() const;
memory::desc diff_weights_peephole_desc() const;
memory::desc diff_weights_projection_desc() const;
memory::desc diff_bias_desc() const;
memory::desc diff_dst_layer_desc() const;
memory::desc diff_dst_iter_desc() const;
memory::desc diff_dst_iter_c_desc() const;
primitive_desc();
Detailed Documentation
Primitive descriptor for an LSTM backward propagation primitive.
Construction
primitive_desc()
Default constructor. Produces an empty object.
primitive_desc(
const engine& aengine,
prop_kind aprop_kind,
rnn_direction direction,
const memory::desc& src_layer_desc,
const memory::desc& src_iter_desc,
const memory::desc& src_iter_c_desc,
const memory::desc& weights_layer_desc,
const memory::desc& weights_iter_desc,
const memory::desc& weights_peephole_desc,
const memory::desc& weights_projection_desc,
const memory::desc& bias_desc,
const memory::desc& dst_layer_desc,
const memory::desc& dst_iter_desc,
const memory::desc& dst_iter_c_desc,
const memory::desc& diff_src_layer_desc,
const memory::desc& diff_src_iter_desc,
const memory::desc& diff_src_iter_c_desc,
const memory::desc& diff_weights_layer_desc,
const memory::desc& diff_weights_iter_desc,
const memory::desc& diff_weights_peephole_desc,
const memory::desc& diff_weights_projection_desc,
const memory::desc& diff_bias_desc,
const memory::desc& diff_dst_layer_desc,
const memory::desc& diff_dst_iter_desc,
const memory::desc& diff_dst_iter_c_desc,
const lstm_forward::primitive_desc& hint_fwd_pd,
const primitive_attr& attr = default_attr(),
bool allow_empty = false
)
Constructs an LSTM (with or without peephole and with or without projection) primitive descriptor for backward propagation using prop_kind, direction, and memory descriptors.
The following arguments may point to a zero memory descriptor:
src_iter_desc together with src_iter_c_desc, diff_src_iter_desc, and diff_src_iter_c_desc,
weights_peephole_desc together with diff_weights_peephole_desc
bias_desc together with diff_bias_desc,
dst_iter_desc together with dst_iter_c_desc, diff_dst_iter_desc, and diff_dst_iter_c_desc.
This would then indicate that the LSTM backward propagation primitive should not use them and should default to zero values instead.
The weights_projection_desc together with diff_weights_projection_desc may point to a zero memory descriptor. This would then indicate that the LSTM doesn’t have recurrent projection layer.
Parameters:
aengine |
Engine to use. |
aprop_kind |
Propagation kind. Must be dnnl::prop_kind::backward. |
direction |
RNN direction. See dnnl::rnn_direction for more info. |
src_layer_desc |
Memory descriptor for the input vector. |
src_iter_desc |
Memory descriptor for the input recurrent hidden state vector. |
src_iter_c_desc |
Memory descriptor for the input recurrent cell state vector. |
weights_layer_desc |
Memory descriptor for the weights applied to the layer input. |
weights_iter_desc |
Memory descriptor for the weights applied to the recurrent input. |
weights_peephole_desc |
Memory descriptor for the weights applied to the cell states (according to the Peephole LSTM formula). |
weights_projection_desc |
Memory descriptor for the weights applied to the hidden states to get the recurrent projection (according to the Projection LSTM formula). |
bias_desc |
Bias memory descriptor. |
dst_layer_desc |
Memory descriptor for the output vector. |
dst_iter_desc |
Memory descriptor for the output recurrent hidden state vector. |
dst_iter_c_desc |
Memory descriptor for the output recurrent cell state vector. |
diff_src_layer_desc |
Memory descriptor for the diff of input vector. |
diff_src_iter_desc |
Memory descriptor for the diff of input recurrent hidden state vector. |
diff_src_iter_c_desc |
Memory descriptor for the diff of input recurrent cell state vector. |
diff_weights_layer_desc |
Memory descriptor for the diff of weights applied to the layer input. |
diff_weights_iter_desc |
Memory descriptor for the diff of weights applied to the recurrent input. |
diff_weights_peephole_desc |
Memory descriptor for the diff of weights applied to the cell states (according to the Peephole LSTM formula). |
diff_weights_projection_desc |
Memory descriptor for the diff of weights applied to the hidden states to get the recurrent projection (according to the Projection LSTM formula). |
diff_bias_desc |
Diff bias memory descriptor. |
diff_dst_layer_desc |
Memory descriptor for the diff of output vector. |
diff_dst_iter_desc |
Memory descriptor for the diff of output recurrent hidden state vector. |
diff_dst_iter_c_desc |
Memory descriptor for the diff of output recurrent cell state vector. |
hint_fwd_pd |
Primitive descriptor for an LSTM 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,
prop_kind aprop_kind,
rnn_direction direction,
const memory::desc& src_layer_desc,
const memory::desc& src_iter_desc,
const memory::desc& src_iter_c_desc,
const memory::desc& weights_layer_desc,
const memory::desc& weights_iter_desc,
const memory::desc& weights_peephole_desc,
const memory::desc& bias_desc,
const memory::desc& dst_layer_desc,
const memory::desc& dst_iter_desc,
const memory::desc& dst_iter_c_desc,
const memory::desc& diff_src_layer_desc,
const memory::desc& diff_src_iter_desc,
const memory::desc& diff_src_iter_c_desc,
const memory::desc& diff_weights_layer_desc,
const memory::desc& diff_weights_iter_desc,
const memory::desc& diff_weights_peephole_desc,
const memory::desc& diff_bias_desc,
const memory::desc& diff_dst_layer_desc,
const memory::desc& diff_dst_iter_desc,
const memory::desc& diff_dst_iter_c_desc,
const lstm_forward::primitive_desc& hint_fwd_pd,
const primitive_attr& attr = default_attr(),
bool allow_empty = false
)
Constructs an LSTM (with or without peephole) primitive descriptor for backward propagation using prop_kind, direction, and memory descriptors.
The following arguments may point to a zero memory descriptor:
src_iter_desc together with src_iter_c_desc, diff_src_iter_desc, and diff_src_iter_c_desc,
weights_peephole_desc together with diff_weights_peephole_desc
bias_desc together with diff_bias_desc,
dst_iter_desc together with dst_iter_c_desc, diff_dst_iter_desc, and diff_dst_iter_c_desc.
This would then indicate that the LSTM backward propagation primitive should not use them and should default to zero values instead.
Parameters:
aengine |
Engine to use. |
aprop_kind |
Propagation kind. Must be dnnl::prop_kind::backward. |
direction |
RNN direction. See dnnl::rnn_direction for more info. |
src_layer_desc |
Memory descriptor for the input vector. |
src_iter_desc |
Memory descriptor for the input recurrent hidden state vector. |
src_iter_c_desc |
Memory descriptor for the input recurrent cell state vector. |
weights_layer_desc |
Memory descriptor for the weights applied to the layer input. |
weights_iter_desc |
Memory descriptor for the weights applied to the recurrent input. |
weights_peephole_desc |
Memory descriptor for the weights applied to the cell states (according to the Peephole LSTM formula). |
bias_desc |
Bias memory descriptor. |
dst_layer_desc |
Memory descriptor for the output vector. |
dst_iter_desc |
Memory descriptor for the output recurrent hidden state vector. |
dst_iter_c_desc |
Memory descriptor for the output recurrent cell state vector. |
diff_src_layer_desc |
Memory descriptor for the diff of input vector. |
diff_src_iter_desc |
Memory descriptor for the diff of input recurrent hidden state vector. |
diff_src_iter_c_desc |
Memory descriptor for the diff of input recurrent cell state vector. |
diff_weights_layer_desc |
Memory descriptor for the diff of weights applied to the layer input. |
diff_weights_iter_desc |
Memory descriptor for the diff of weights applied to the recurrent input. |
diff_weights_peephole_desc |
Memory descriptor for the diff of weights applied to the cell states (according to the Peephole LSTM formula). |
diff_bias_desc |
Diff bias memory descriptor. |
diff_dst_layer_desc |
Memory descriptor for the diff of output vector. |
diff_dst_iter_desc |
Memory descriptor for the diff of output recurrent hidden state vector. |
diff_dst_iter_c_desc |
Memory descriptor for the diff of output recurrent cell state vector. |
hint_fwd_pd |
Primitive descriptor for an LSTM 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,
prop_kind aprop_kind,
rnn_direction direction,
const memory::desc& src_layer_desc,
const memory::desc& src_iter_desc,
const memory::desc& src_iter_c_desc,
const memory::desc& weights_layer_desc,
const memory::desc& weights_iter_desc,
const memory::desc& bias_desc,
const memory::desc& dst_layer_desc,
const memory::desc& dst_iter_desc,
const memory::desc& dst_iter_c_desc,
const memory::desc& diff_src_layer_desc,
const memory::desc& diff_src_iter_desc,
const memory::desc& diff_src_iter_c_desc,
const memory::desc& diff_weights_layer_desc,
const memory::desc& diff_weights_iter_desc,
const memory::desc& diff_bias_desc,
const memory::desc& diff_dst_layer_desc,
const memory::desc& diff_dst_iter_desc,
const memory::desc& diff_dst_iter_c_desc,
const lstm_forward::primitive_desc& hint_fwd_pd,
const primitive_attr& attr = default_attr(),
bool allow_empty = false
)
Constructs an LSTM primitive descriptor for backward propagation using prop_kind, direction, and memory descriptors.
The following arguments may point to a zero memory descriptor:
src_iter_desc together with src_iter_c_desc, diff_src_iter_desc, and diff_src_iter_c_desc,
bias_desc together with diff_bias_desc,
dst_iter_desc together with dst_iter_c_desc, diff_dst_iter_desc, and diff_dst_iter_c_desc.
This would then indicate that the LSTM backward propagation primitive should not use them and should default to zero values instead.
Parameters:
aengine |
Engine to use. |
aprop_kind |
Propagation kind. Must be dnnl::prop_kind::backward. |
direction |
RNN direction. See dnnl::rnn_direction for more info. |
src_layer_desc |
Memory descriptor for the input vector. |
src_iter_desc |
Memory descriptor for the input recurrent hidden state vector. |
src_iter_c_desc |
Memory descriptor for the input recurrent cell state vector. |
weights_layer_desc |
Memory descriptor for the weights applied to the layer input. |
weights_iter_desc |
Memory descriptor for the weights applied to the recurrent input. |
bias_desc |
Bias memory descriptor. |
dst_layer_desc |
Memory descriptor for the output vector. |
dst_iter_desc |
Memory descriptor for the output recurrent hidden state vector. |
dst_iter_c_desc |
Memory descriptor for the output recurrent cell state vector. |
diff_src_layer_desc |
Memory descriptor for the diff of input vector. |
diff_src_iter_desc |
Memory descriptor for the diff of input recurrent hidden state vector. |
diff_src_iter_c_desc |
Memory descriptor for the diff of input recurrent cell state vector. |
diff_weights_layer_desc |
Memory descriptor for the diff of weights applied to the layer input. |
diff_weights_iter_desc |
Memory descriptor for the diff of weights applied to the recurrent input. |
diff_bias_desc |
Diff bias memory descriptor. |
diff_dst_layer_desc |
Memory descriptor for the diff of output vector. |
diff_dst_iter_desc |
Memory descriptor for the diff of output recurrent hidden state vector. |
diff_dst_iter_c_desc |
Memory descriptor for the diff of output recurrent cell state vector. |
hint_fwd_pd |
Primitive descriptor for a convolution 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 LSTM backward propagation primitive from a C API primitive descriptor that must have a matching kind.
Parameters:
pd |
C API primitive descriptor for an LSTM backward propagation primitive. |
Methods
memory::desc src_layer_desc() const
Returns source layer memory descriptor.
Returns:
Source layer memory descriptor.
memory::desc src_iter_desc() const
Returns source iteration memory descriptor.
Returns:
Source iteration memory descriptor.
A zero memory descriptor if the primitive does not have a source iteration parameter.
memory::desc src_iter_c_desc() const
Returns source iteration memory descriptor.
Returns:
Source iteration memory descriptor.
A zero memory descriptor if the primitive does not have a source iteration parameter.
memory::desc weights_layer_desc() const
Returns weights layer memory descriptor.
Returns:
Weights layer memory descriptor.
memory::desc weights_iter_desc() const
Returns weights iteration memory descriptor.
Returns:
Weights iteration memory descriptor.
memory::desc weights_peephole_desc() const
Returns weights peephole memory descriptor.
Returns:
Weights peephole memory descriptor.
memory::desc weights_projection_desc() const
Returns weights projection memory descriptor.
Returns:
Weights projection memory descriptor.
memory::desc bias_desc() const
Returns bias memory descriptor.
Returns:
Bias memory descriptor.
A zero memory descriptor if the primitive does not have a bias parameter.
memory::desc dst_layer_desc() const
Returns destination layer memory descriptor.
Returns:
Destination layer memory descriptor.
memory::desc dst_iter_desc() const
Returns destination iteration memory descriptor.
Returns:
Destination iteration memory descriptor.
A zero memory descriptor if the primitive does not have a destination iteration parameter.
memory::desc dst_iter_c_desc() const
Returns source iteration memory descriptor.
Returns:
Source iteration memory descriptor.
A zero memory descriptor if the primitive does not have a source iteration parameter.
memory::desc workspace_desc() const
Returns the workspace memory descriptor.
Returns:
Workspace memory descriptor.
A zero memory descriptor if the primitive does not require workspace parameter.
memory::desc diff_src_layer_desc() const
Returns diff source layer memory descriptor.
Returns:
Diff source layer memory descriptor.
memory::desc diff_src_iter_desc() const
Returns diff source iteration memory descriptor.
Returns:
Diff source iteration memory descriptor.
A zero memory descriptor if the primitive does not have a diff source iteration parameter.
memory::desc diff_src_iter_c_desc() const
Returns diff source recurrent cell state memory descriptor.
Returns:
Diff source recurrent cell state memory descriptor.
memory::desc diff_weights_layer_desc() const
Returns diff weights layer memory descriptor.
Returns:
Diff weights layer memory descriptor.
memory::desc diff_weights_iter_desc() const
Returns diff weights iteration memory descriptor.
Returns:
Diff weights iteration memory descriptor.
memory::desc diff_weights_peephole_desc() const
Returns diff weights peephole memory descriptor.
Returns:
Diff weights peephole memory descriptor.
memory::desc diff_weights_projection_desc() const
Returns diff weights projection memory descriptor.
Returns:
Diff weights projection memory descriptor.
memory::desc diff_bias_desc() const
Returns diff bias memory descriptor.
Returns:
Diff bias memory descriptor.
A zero memory descriptor if the primitive does not have a diff bias parameter.
memory::desc diff_dst_layer_desc() const
Returns diff destination layer memory descriptor.
Returns:
Diff destination layer memory descriptor.
memory::desc diff_dst_iter_desc() const
Returns diff destination iteration memory descriptor.
Returns:
Diff destination iteration memory descriptor.
A zero memory descriptor if the primitive does not have a diff destination iteration parameter.
memory::desc diff_dst_iter_c_desc() const
Returns diff destination recurrent cell state memory descriptor.
Returns:
Diff destination recurrent cell state memory descriptor.
algorithm get_cell_kind() const
Returns an RNN cell kind parameter.
Returns:
An RNN cell kind parameter.
dnnl::algorithm::undef if the primitive does not have an RNN cell kind parameter.
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.
rnn_direction get_direction() const
Returns an RNN direction parameter.
Returns:
An RNN direction parameter.
dnnl::rnn_direction::undef if the primitive does not have an RNN direction parameter.