.. index:: pair: group; RNN .. _doxid-group__dnnl__api__rnn: RNN === .. toctree:: :hidden: enum_dnnl_rnn_direction_t.rst enum_dnnl_rnn_flags_t.rst enum_dnnl_rnn_direction.rst enum_dnnl_rnn_flags.rst struct_dnnl_rnn_desc_t.rst struct_dnnl_gru_backward.rst struct_dnnl_gru_forward.rst struct_dnnl_lbr_gru_backward.rst struct_dnnl_lbr_gru_forward.rst struct_dnnl_lstm_backward.rst struct_dnnl_lstm_forward.rst struct_dnnl_rnn_primitive_desc_base.rst struct_dnnl_vanilla_rnn_backward.rst struct_dnnl_vanilla_rnn_forward.rst Overview ~~~~~~~~ A primitive to compute recurrent neural network layers. :ref:`More...` .. ref-code-block:: cpp :class: doxyrest-overview-code-block // enums enum :ref:`dnnl_rnn_direction_t`; enum :ref:`dnnl_rnn_flags_t`; enum :ref:`dnnl::rnn_direction`; enum :ref:`dnnl::rnn_flags`; // structs struct :ref:`dnnl_rnn_desc_t`; struct :ref:`dnnl::gru_backward`; struct :ref:`dnnl::gru_forward`; struct :ref:`dnnl::lbr_gru_backward`; struct :ref:`dnnl::lbr_gru_forward`; struct :ref:`dnnl::lstm_backward`; struct :ref:`dnnl::lstm_forward`; struct :ref:`dnnl::rnn_primitive_desc_base`; struct :ref:`dnnl::vanilla_rnn_backward`; struct :ref:`dnnl::vanilla_rnn_forward`; // global functions :ref:`dnnl_rnn_flags_t` :ref:`dnnl::convert_to_c`(:ref:`rnn_flags` flags); :ref:`dnnl_rnn_direction_t` :ref:`dnnl::convert_to_c`(:ref:`rnn_direction` dir); :ref:`dnnl_status_t` DNNL_API :ref:`dnnl_vanilla_rnn_forward_desc_init`( :ref:`dnnl_rnn_desc_t`* rnn_desc, :ref:`dnnl_prop_kind_t` prop_kind, const :ref:`dnnl_alg_kind_t` activation, const :ref:`dnnl_rnn_direction_t` direction, const :ref:`dnnl_memory_desc_t`* src_layer_desc, const :ref:`dnnl_memory_desc_t`* src_iter_desc, const :ref:`dnnl_memory_desc_t`* weights_layer_desc, const :ref:`dnnl_memory_desc_t`* weights_iter_desc, const :ref:`dnnl_memory_desc_t`* bias_desc, const :ref:`dnnl_memory_desc_t`* dst_layer_desc, const :ref:`dnnl_memory_desc_t`* dst_iter_desc, unsigned flags, float alpha, float beta ); :ref:`dnnl_status_t` DNNL_API :ref:`dnnl_vanilla_rnn_backward_desc_init`( :ref:`dnnl_rnn_desc_t`* rnn_desc, :ref:`dnnl_prop_kind_t` prop_kind, const :ref:`dnnl_alg_kind_t` activation, const :ref:`dnnl_rnn_direction_t` direction, const :ref:`dnnl_memory_desc_t`* src_layer_desc, const :ref:`dnnl_memory_desc_t`* src_iter_desc, const :ref:`dnnl_memory_desc_t`* weights_layer_desc, const :ref:`dnnl_memory_desc_t`* weights_iter_desc, const :ref:`dnnl_memory_desc_t`* bias_desc, const :ref:`dnnl_memory_desc_t`* dst_layer_desc, const :ref:`dnnl_memory_desc_t`* dst_iter_desc, const :ref:`dnnl_memory_desc_t`* diff_src_layer_desc, const :ref:`dnnl_memory_desc_t`* diff_src_iter_desc, const :ref:`dnnl_memory_desc_t`* diff_weights_layer_desc, const :ref:`dnnl_memory_desc_t`* diff_weights_iter_desc, const :ref:`dnnl_memory_desc_t`* diff_bias_desc, const :ref:`dnnl_memory_desc_t`* diff_dst_layer_desc, const :ref:`dnnl_memory_desc_t`* diff_dst_iter_desc, unsigned flags, float alpha, float beta ); :ref:`dnnl_status_t` DNNL_API :ref:`dnnl_lstm_forward_desc_init`( :ref:`dnnl_rnn_desc_t`* rnn_desc, :ref:`dnnl_prop_kind_t` prop_kind, :ref:`dnnl_rnn_direction_t` direction, const :ref:`dnnl_memory_desc_t`* src_layer_desc, const :ref:`dnnl_memory_desc_t`* src_iter_desc, const :ref:`dnnl_memory_desc_t`* src_iter_c_desc, const :ref:`dnnl_memory_desc_t`* weights_layer_desc, const :ref:`dnnl_memory_desc_t`* weights_iter_desc, const :ref:`dnnl_memory_desc_t`* bias_desc, const :ref:`dnnl_memory_desc_t`* dst_layer_desc, const :ref:`dnnl_memory_desc_t`* dst_iter_desc, const :ref:`dnnl_memory_desc_t`* dst_iter_c_desc, unsigned flags ); :ref:`dnnl_status_t` DNNL_API :ref:`dnnl_lstm_forward_desc_init_v2`( :ref:`dnnl_rnn_desc_t`* rnn_desc, :ref:`dnnl_prop_kind_t` prop_kind, :ref:`dnnl_rnn_direction_t` direction, const :ref:`dnnl_memory_desc_t`* src_layer_desc, const :ref:`dnnl_memory_desc_t`* src_iter_desc, const :ref:`dnnl_memory_desc_t`* src_iter_c_desc, const :ref:`dnnl_memory_desc_t`* weights_layer_desc, const :ref:`dnnl_memory_desc_t`* weights_iter_desc, const :ref:`dnnl_memory_desc_t`* weights_peephole_desc, const :ref:`dnnl_memory_desc_t`* bias_desc, const :ref:`dnnl_memory_desc_t`* dst_layer_desc, const :ref:`dnnl_memory_desc_t`* dst_iter_desc, const :ref:`dnnl_memory_desc_t`* dst_iter_c_desc, unsigned flags ); :ref:`dnnl_status_t` DNNL_API :ref:`dnnl_lstm_forward_desc_init_v3`( :ref:`dnnl_rnn_desc_t`* rnn_desc, :ref:`dnnl_prop_kind_t` prop_kind, :ref:`dnnl_rnn_direction_t` direction, const :ref:`dnnl_memory_desc_t`* src_layer_desc, const :ref:`dnnl_memory_desc_t`* src_iter_desc, const :ref:`dnnl_memory_desc_t`* src_iter_c_desc, const :ref:`dnnl_memory_desc_t`* weights_layer_desc, const :ref:`dnnl_memory_desc_t`* weights_iter_desc, const :ref:`dnnl_memory_desc_t`* weights_peephole_desc, const :ref:`dnnl_memory_desc_t`* weights_projection_desc, const :ref:`dnnl_memory_desc_t`* bias_desc, const :ref:`dnnl_memory_desc_t`* dst_layer_desc, const :ref:`dnnl_memory_desc_t`* dst_iter_desc, const :ref:`dnnl_memory_desc_t`* dst_iter_c_desc, unsigned flags ); :ref:`dnnl_status_t` DNNL_API :ref:`dnnl_lstm_backward_desc_init`( :ref:`dnnl_rnn_desc_t`* rnn_desc, :ref:`dnnl_prop_kind_t` prop_kind, :ref:`dnnl_rnn_direction_t` direction, const :ref:`dnnl_memory_desc_t`* src_layer_desc, const :ref:`dnnl_memory_desc_t`* src_iter_desc, const :ref:`dnnl_memory_desc_t`* src_iter_c_desc, const :ref:`dnnl_memory_desc_t`* weights_layer_desc, const :ref:`dnnl_memory_desc_t`* weights_iter_desc, const :ref:`dnnl_memory_desc_t`* bias_desc, const :ref:`dnnl_memory_desc_t`* dst_layer_desc, const :ref:`dnnl_memory_desc_t`* dst_iter_desc, const :ref:`dnnl_memory_desc_t`* dst_iter_c_desc, const :ref:`dnnl_memory_desc_t`* diff_src_layer_desc, const :ref:`dnnl_memory_desc_t`* diff_src_iter_desc, const :ref:`dnnl_memory_desc_t`* diff_src_iter_c_desc, const :ref:`dnnl_memory_desc_t`* diff_weights_layer_desc, const :ref:`dnnl_memory_desc_t`* diff_weights_iter_desc, const :ref:`dnnl_memory_desc_t`* diff_bias_desc, const :ref:`dnnl_memory_desc_t`* diff_dst_layer_desc, const :ref:`dnnl_memory_desc_t`* diff_dst_iter_desc, const :ref:`dnnl_memory_desc_t`* diff_dst_iter_c_desc, unsigned flags ); :ref:`dnnl_status_t` DNNL_API :ref:`dnnl_lstm_backward_desc_init_v2`( :ref:`dnnl_rnn_desc_t`* rnn_desc, :ref:`dnnl_prop_kind_t` prop_kind, :ref:`dnnl_rnn_direction_t` direction, const :ref:`dnnl_memory_desc_t`* src_layer_desc, const :ref:`dnnl_memory_desc_t`* src_iter_desc, const :ref:`dnnl_memory_desc_t`* src_iter_c_desc, const :ref:`dnnl_memory_desc_t`* weights_layer_desc, const :ref:`dnnl_memory_desc_t`* weights_iter_desc, const :ref:`dnnl_memory_desc_t`* weights_peephole_desc, const :ref:`dnnl_memory_desc_t`* bias_desc, const :ref:`dnnl_memory_desc_t`* dst_layer_desc, const :ref:`dnnl_memory_desc_t`* dst_iter_desc, const :ref:`dnnl_memory_desc_t`* dst_iter_c_desc, const :ref:`dnnl_memory_desc_t`* diff_src_layer_desc, const :ref:`dnnl_memory_desc_t`* diff_src_iter_desc, const :ref:`dnnl_memory_desc_t`* diff_src_iter_c_desc, const :ref:`dnnl_memory_desc_t`* diff_weights_layer_desc, const :ref:`dnnl_memory_desc_t`* diff_weights_iter_desc, const :ref:`dnnl_memory_desc_t`* diff_weights_peephole_desc, const :ref:`dnnl_memory_desc_t`* diff_bias_desc, const :ref:`dnnl_memory_desc_t`* diff_dst_layer_desc, const :ref:`dnnl_memory_desc_t`* diff_dst_iter_desc, const :ref:`dnnl_memory_desc_t`* diff_dst_iter_c_desc, unsigned flags ); :ref:`dnnl_status_t` DNNL_API :ref:`dnnl_lstm_backward_desc_init_v3`( :ref:`dnnl_rnn_desc_t`* rnn_desc, :ref:`dnnl_prop_kind_t` prop_kind, :ref:`dnnl_rnn_direction_t` direction, const :ref:`dnnl_memory_desc_t`* src_layer_desc, const :ref:`dnnl_memory_desc_t`* src_iter_desc, const :ref:`dnnl_memory_desc_t`* src_iter_c_desc, const :ref:`dnnl_memory_desc_t`* weights_layer_desc, const :ref:`dnnl_memory_desc_t`* weights_iter_desc, const :ref:`dnnl_memory_desc_t`* weights_peephole_desc, const :ref:`dnnl_memory_desc_t`* weights_projection_desc, const :ref:`dnnl_memory_desc_t`* bias_desc, const :ref:`dnnl_memory_desc_t`* dst_layer_desc, const :ref:`dnnl_memory_desc_t`* dst_iter_desc, const :ref:`dnnl_memory_desc_t`* dst_iter_c_desc, const :ref:`dnnl_memory_desc_t`* diff_src_layer_desc, const :ref:`dnnl_memory_desc_t`* diff_src_iter_desc, const :ref:`dnnl_memory_desc_t`* diff_src_iter_c_desc, const :ref:`dnnl_memory_desc_t`* diff_weights_layer_desc, const :ref:`dnnl_memory_desc_t`* diff_weights_iter_desc, const :ref:`dnnl_memory_desc_t`* diff_weights_peephole_desc, const :ref:`dnnl_memory_desc_t`* diff_weights_projection_desc, const :ref:`dnnl_memory_desc_t`* diff_bias_desc, const :ref:`dnnl_memory_desc_t`* diff_dst_layer_desc, const :ref:`dnnl_memory_desc_t`* diff_dst_iter_desc, const :ref:`dnnl_memory_desc_t`* diff_dst_iter_c_desc, unsigned flags ); :ref:`dnnl_status_t` DNNL_API :ref:`dnnl_gru_forward_desc_init`( :ref:`dnnl_rnn_desc_t`* rnn_desc, :ref:`dnnl_prop_kind_t` prop_kind, :ref:`dnnl_rnn_direction_t` direction, const :ref:`dnnl_memory_desc_t`* src_layer_desc, const :ref:`dnnl_memory_desc_t`* src_iter_desc, const :ref:`dnnl_memory_desc_t`* weights_layer_desc, const :ref:`dnnl_memory_desc_t`* weights_iter_desc, const :ref:`dnnl_memory_desc_t`* bias_desc, const :ref:`dnnl_memory_desc_t`* dst_layer_desc, const :ref:`dnnl_memory_desc_t`* dst_iter_desc, unsigned flags ); :ref:`dnnl_status_t` DNNL_API :ref:`dnnl_gru_backward_desc_init`( :ref:`dnnl_rnn_desc_t`* rnn_desc, :ref:`dnnl_prop_kind_t` prop_kind, :ref:`dnnl_rnn_direction_t` direction, const :ref:`dnnl_memory_desc_t`* src_layer_desc, const :ref:`dnnl_memory_desc_t`* src_iter_desc, const :ref:`dnnl_memory_desc_t`* weights_layer_desc, const :ref:`dnnl_memory_desc_t`* weights_iter_desc, const :ref:`dnnl_memory_desc_t`* bias_desc, const :ref:`dnnl_memory_desc_t`* dst_layer_desc, const :ref:`dnnl_memory_desc_t`* dst_iter_desc, const :ref:`dnnl_memory_desc_t`* diff_src_layer_desc, const :ref:`dnnl_memory_desc_t`* diff_src_iter_desc, const :ref:`dnnl_memory_desc_t`* diff_weights_layer_desc, const :ref:`dnnl_memory_desc_t`* diff_weights_iter_desc, const :ref:`dnnl_memory_desc_t`* diff_bias_desc, const :ref:`dnnl_memory_desc_t`* diff_dst_layer_desc, const :ref:`dnnl_memory_desc_t`* diff_dst_iter_desc, unsigned flags ); :ref:`dnnl_status_t` DNNL_API :ref:`dnnl_lbr_gru_forward_desc_init`( :ref:`dnnl_rnn_desc_t`* rnn_desc, :ref:`dnnl_prop_kind_t` prop_kind, :ref:`dnnl_rnn_direction_t` direction, const :ref:`dnnl_memory_desc_t`* src_layer_desc, const :ref:`dnnl_memory_desc_t`* src_iter_desc, const :ref:`dnnl_memory_desc_t`* weights_layer_desc, const :ref:`dnnl_memory_desc_t`* weights_iter_desc, const :ref:`dnnl_memory_desc_t`* bias_desc, const :ref:`dnnl_memory_desc_t`* dst_layer_desc, const :ref:`dnnl_memory_desc_t`* dst_iter_desc, unsigned flags ); :ref:`dnnl_status_t` DNNL_API :ref:`dnnl_lbr_gru_backward_desc_init`( :ref:`dnnl_rnn_desc_t`* rnn_desc, :ref:`dnnl_prop_kind_t` prop_kind, :ref:`dnnl_rnn_direction_t` direction, const :ref:`dnnl_memory_desc_t`* src_layer_desc, const :ref:`dnnl_memory_desc_t`* src_iter_desc, const :ref:`dnnl_memory_desc_t`* weights_layer_desc, const :ref:`dnnl_memory_desc_t`* weights_iter_desc, const :ref:`dnnl_memory_desc_t`* bias_desc, const :ref:`dnnl_memory_desc_t`* dst_layer_desc, const :ref:`dnnl_memory_desc_t`* dst_iter_desc, const :ref:`dnnl_memory_desc_t`* diff_src_layer_desc, const :ref:`dnnl_memory_desc_t`* diff_src_iter_desc, const :ref:`dnnl_memory_desc_t`* diff_weights_layer_desc, const :ref:`dnnl_memory_desc_t`* diff_weights_iter_desc, const :ref:`dnnl_memory_desc_t`* diff_bias_desc, const :ref:`dnnl_memory_desc_t`* diff_dst_layer_desc, const :ref:`dnnl_memory_desc_t`* diff_dst_iter_desc, unsigned flags ); .. _details-group__dnnl__api__rnn: Detailed Documentation ~~~~~~~~~~~~~~~~~~~~~~ A primitive to compute recurrent neural network layers. .. rubric:: See also: :ref:`RNN ` in developer guide Global Functions ---------------- .. index:: pair: function; convert_to_c .. _doxid-group__dnnl__api__rnn_1ga0a340195a137f906e858418d91397777: .. ref-code-block:: cpp :class: doxyrest-title-code-block :ref:`dnnl_rnn_flags_t` dnnl::convert_to_c(:ref:`rnn_flags` flags) Converts RNN cell flags enum value from C++ API to C API type. .. rubric:: Parameters: .. list-table:: :widths: 20 80 * - flags - C++ API RNN cell flags enum value. .. rubric:: Returns: Corresponding C API RNN cell flags enum value. .. index:: pair: function; convert_to_c .. _doxid-group__dnnl__api__rnn_1ga1915ea2d2fe94077fa30734ced88a225: .. ref-code-block:: cpp :class: doxyrest-title-code-block :ref:`dnnl_rnn_direction_t` dnnl::convert_to_c(:ref:`rnn_direction` dir) Converts RNN direction enum value from C++ API to C API type. .. rubric:: Parameters: .. list-table:: :widths: 20 80 * - dir - C++ API RNN direction enum value. .. rubric:: Returns: Corresponding C API RNN direction enum value. .. index:: pair: function; dnnl_vanilla_rnn_forward_desc_init .. _doxid-group__dnnl__api__rnn_1ga49396cd1b79742d7186446618dd177df: .. ref-code-block:: cpp :class: doxyrest-title-code-block :ref:`dnnl_status_t` DNNL_API dnnl_vanilla_rnn_forward_desc_init( :ref:`dnnl_rnn_desc_t`* rnn_desc, :ref:`dnnl_prop_kind_t` prop_kind, const :ref:`dnnl_alg_kind_t` activation, const :ref:`dnnl_rnn_direction_t` direction, const :ref:`dnnl_memory_desc_t`* src_layer_desc, const :ref:`dnnl_memory_desc_t`* src_iter_desc, const :ref:`dnnl_memory_desc_t`* weights_layer_desc, const :ref:`dnnl_memory_desc_t`* weights_iter_desc, const :ref:`dnnl_memory_desc_t`* bias_desc, const :ref:`dnnl_memory_desc_t`* dst_layer_desc, const :ref:`dnnl_memory_desc_t`* dst_iter_desc, unsigned flags, float alpha, float beta ) Initializes a descriptor for vanilla RNN forward propagation primitive. The following arguments may either be ``NULL`` or point to a zero memory descriptor: * ``src_iter_desc``, * ``bias_desc``, * ``dst_iter_desc``. This would then indicate that the RNN forward propagation primitive should not use them and should default to zero values instead. .. note:: All memory descriptors can be initialized with :ref:`dnnl_format_tag_any ` or with format_kind set to :ref:`dnnl_format_kind_any `. .. rubric:: Parameters: .. list-table:: :widths: 20 80 * - rnn_desc - Output descriptor for vanilla RNN primitive. * - prop_kind - Propagation kind. Possible values are :ref:`dnnl_forward_training ` and :ref:`dnnl_forward_inference `. * - activation - Activation kind. Possible values are :ref:`dnnl_eltwise_relu `, :ref:`dnnl_eltwise_tanh ` or :ref:`dnnl_eltwise_logistic `. * - direction - RNN direction. See :ref:`dnnl_rnn_direction_t ` for more info. * - src_layer_desc - Memory descriptor for the input vector. * - src_iter_desc - Memory descriptor for the input recurrent hidden 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. * - flags - Unused. * - alpha - Negative slope if activation is :ref:`dnnl_eltwise_relu `. * - beta - Unused. .. rubric:: Returns: :ref:`dnnl_success ` on success and a status describing the error otherwise. .. index:: pair: function; dnnl_vanilla_rnn_backward_desc_init .. _doxid-group__dnnl__api__rnn_1ga731d97d4b6ac94653734c2065759492b: .. ref-code-block:: cpp :class: doxyrest-title-code-block :ref:`dnnl_status_t` DNNL_API dnnl_vanilla_rnn_backward_desc_init( :ref:`dnnl_rnn_desc_t`* rnn_desc, :ref:`dnnl_prop_kind_t` prop_kind, const :ref:`dnnl_alg_kind_t` activation, const :ref:`dnnl_rnn_direction_t` direction, const :ref:`dnnl_memory_desc_t`* src_layer_desc, const :ref:`dnnl_memory_desc_t`* src_iter_desc, const :ref:`dnnl_memory_desc_t`* weights_layer_desc, const :ref:`dnnl_memory_desc_t`* weights_iter_desc, const :ref:`dnnl_memory_desc_t`* bias_desc, const :ref:`dnnl_memory_desc_t`* dst_layer_desc, const :ref:`dnnl_memory_desc_t`* dst_iter_desc, const :ref:`dnnl_memory_desc_t`* diff_src_layer_desc, const :ref:`dnnl_memory_desc_t`* diff_src_iter_desc, const :ref:`dnnl_memory_desc_t`* diff_weights_layer_desc, const :ref:`dnnl_memory_desc_t`* diff_weights_iter_desc, const :ref:`dnnl_memory_desc_t`* diff_bias_desc, const :ref:`dnnl_memory_desc_t`* diff_dst_layer_desc, const :ref:`dnnl_memory_desc_t`* diff_dst_iter_desc, unsigned flags, float alpha, float beta ) Initializes a descriptor for vanilla RNN backward propagation primitive. The following arguments may either be ``NULL`` or point to a zero memory descriptor: * ``src_iter_desc`` together with ``diff_src_iter_desc``, * ``bias_desc`` together with ``diff_bias_desc``, * ``dst_iter_desc`` together with ``diff_dst_iter_desc``. This would then indicate that the RNN backward propagation primitive should not use the respective data and should use zero values instead. .. note:: All memory descriptors can be initialized with :ref:`dnnl_format_tag_any ` or with format_kind set to :ref:`dnnl_format_kind_any `. .. rubric:: Parameters: .. list-table:: :widths: 20 80 * - rnn_desc - Output descriptor for vanilla RNN primitive. * - prop_kind - Propagation kind. Must be :ref:`dnnl_backward `. * - activation - Activation kind. Possible values are :ref:`dnnl_eltwise_relu `, :ref:`dnnl_eltwise_tanh ` or :ref:`dnnl_eltwise_logistic `. * - direction - RNN direction. See :ref:`dnnl_rnn_direction_t ` for more info. * - src_layer_desc - Memory descriptor for the input vector. * - src_iter_desc - Memory descriptor for the input recurrent hidden 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. * - 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_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. * - flags - Unused. * - alpha - Negative slope if activation is :ref:`dnnl_eltwise_relu `. * - beta - Unused. .. rubric:: Returns: :ref:`dnnl_success ` on success and a status describing the error otherwise. .. index:: pair: function; dnnl_lstm_forward_desc_init .. _doxid-group__dnnl__api__rnn_1gabfc48e17679206624fb1e0b5cbdc9539: .. ref-code-block:: cpp :class: doxyrest-title-code-block :ref:`dnnl_status_t` DNNL_API dnnl_lstm_forward_desc_init( :ref:`dnnl_rnn_desc_t`* rnn_desc, :ref:`dnnl_prop_kind_t` prop_kind, :ref:`dnnl_rnn_direction_t` direction, const :ref:`dnnl_memory_desc_t`* src_layer_desc, const :ref:`dnnl_memory_desc_t`* src_iter_desc, const :ref:`dnnl_memory_desc_t`* src_iter_c_desc, const :ref:`dnnl_memory_desc_t`* weights_layer_desc, const :ref:`dnnl_memory_desc_t`* weights_iter_desc, const :ref:`dnnl_memory_desc_t`* bias_desc, const :ref:`dnnl_memory_desc_t`* dst_layer_desc, const :ref:`dnnl_memory_desc_t`* dst_iter_desc, const :ref:`dnnl_memory_desc_t`* dst_iter_c_desc, unsigned flags ) Initializes a descriptor for LSTM forward propagation primitive. The following arguments may either be ``NULL`` or point to a zero memory descriptor: * ``src_iter_desc`` together with ``src_iter_c_desc``, * ``bias_desc``, * ``dst_iter_desc`` together with ``dst_iter_c_desc``. This would then indicate that the LSTM forward propagation primitive should not use them and should default to zero values instead. .. note:: All memory descriptors can be initialized with :ref:`dnnl_format_tag_any ` or with format_kind set to :ref:`dnnl_format_kind_any `. .. rubric:: Parameters: .. list-table:: :widths: 20 80 * - rnn_desc - Output descriptor for LSTM primitive. * - prop_kind - Propagation kind. Possible values are :ref:`dnnl_forward_training ` and :ref:`dnnl_forward_inference `. * - direction - RNN direction. See :ref:`dnnl_rnn_direction_t ` 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. * - flags - Unused. .. rubric:: Returns: :ref:`dnnl_success ` on success and a status describing the error otherwise. .. rubric:: See also: :ref:`dnnl_lstm_forward_desc_init_v2 ` to initialize forward LSTM with and without peephole :ref:`dnnl_lstm_forward_desc_init_v3 ` to initialize forward LSTM with and without peephole / recurrent projection layer .. index:: pair: function; dnnl_lstm_forward_desc_init_v2 .. _doxid-group__dnnl__api__rnn_1gad9b01827d9c54ce4e6a09a25abe5fb55: .. ref-code-block:: cpp :class: doxyrest-title-code-block :ref:`dnnl_status_t` DNNL_API dnnl_lstm_forward_desc_init_v2( :ref:`dnnl_rnn_desc_t`* rnn_desc, :ref:`dnnl_prop_kind_t` prop_kind, :ref:`dnnl_rnn_direction_t` direction, const :ref:`dnnl_memory_desc_t`* src_layer_desc, const :ref:`dnnl_memory_desc_t`* src_iter_desc, const :ref:`dnnl_memory_desc_t`* src_iter_c_desc, const :ref:`dnnl_memory_desc_t`* weights_layer_desc, const :ref:`dnnl_memory_desc_t`* weights_iter_desc, const :ref:`dnnl_memory_desc_t`* weights_peephole_desc, const :ref:`dnnl_memory_desc_t`* bias_desc, const :ref:`dnnl_memory_desc_t`* dst_layer_desc, const :ref:`dnnl_memory_desc_t`* dst_iter_desc, const :ref:`dnnl_memory_desc_t`* dst_iter_c_desc, unsigned flags ) Initializes a descriptor for an LSTM (with or without peephole) forward propagation primitive. The following arguments may either be ``NULL`` or point to a zero memory descriptor: * ``src_iter_desc`` together with ``src_iter_c_desc``, * ``weights_peephole_desc``, * ``bias_desc``, * ``dst_iter_desc`` together with ``dst_iter_c_desc``. This would then indicate that the LSTM forward propagation primitive should not use them and should default to zero values instead. .. note:: All memory descriptors can be initialized with :ref:`dnnl_format_tag_any ` or with format_kind set to :ref:`dnnl_format_kind_any `. .. rubric:: Parameters: .. list-table:: :widths: 20 80 * - rnn_desc - Output descriptor for LSTM primitive. * - prop_kind - Propagation kind. Possible values are :ref:`dnnl_forward_training ` and :ref:`dnnl_forward_inference `. * - direction - RNN direction. See :ref:`dnnl_rnn_direction_t ` 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. * - flags - Unused. .. rubric:: Returns: :ref:`dnnl_success ` on success and a status describing the error otherwise. .. rubric:: See also: :ref:`dnnl_lstm_forward_desc_init_v3 ` to initialize forward LSTM with and without peephole / recurrent projection layer .. index:: pair: function; dnnl_lstm_forward_desc_init_v3 .. _doxid-group__dnnl__api__rnn_1gac8b27af5eba355e35962ef996060b824: .. ref-code-block:: cpp :class: doxyrest-title-code-block :ref:`dnnl_status_t` DNNL_API dnnl_lstm_forward_desc_init_v3( :ref:`dnnl_rnn_desc_t`* rnn_desc, :ref:`dnnl_prop_kind_t` prop_kind, :ref:`dnnl_rnn_direction_t` direction, const :ref:`dnnl_memory_desc_t`* src_layer_desc, const :ref:`dnnl_memory_desc_t`* src_iter_desc, const :ref:`dnnl_memory_desc_t`* src_iter_c_desc, const :ref:`dnnl_memory_desc_t`* weights_layer_desc, const :ref:`dnnl_memory_desc_t`* weights_iter_desc, const :ref:`dnnl_memory_desc_t`* weights_peephole_desc, const :ref:`dnnl_memory_desc_t`* weights_projection_desc, const :ref:`dnnl_memory_desc_t`* bias_desc, const :ref:`dnnl_memory_desc_t`* dst_layer_desc, const :ref:`dnnl_memory_desc_t`* dst_iter_desc, const :ref:`dnnl_memory_desc_t`* dst_iter_c_desc, unsigned flags ) Initializes a descriptor for an LSTM (with or without peephole and with or without recurrent projection layer) forward propagation primitive. The following arguments may either be ``NULL`` or point to a zero memory descriptor: * ``src_iter_desc`` together with ``src_iter_c_desc``, * ``weights_peephole_desc``, * ``bias_desc``, * ``dst_iter_desc`` together with ``dst_iter_c_desc``. This would then indicate that the LSTM forward propagation primitive should not use them and should default to zero values instead. The ``weights_projection_desc`` could either be ``NULL`` or point to a zero memory descriptor. This would then indicate that the LSTM doesn't have recurrent projection layer. .. note:: All memory descriptors can be initialized with :ref:`dnnl_format_tag_any ` or with format_kind set to :ref:`dnnl_format_kind_any `. .. rubric:: Parameters: .. list-table:: :widths: 20 80 * - rnn_desc - Output descriptor for LSTM primitive. * - prop_kind - Propagation kind. Possible values are :ref:`dnnl_forward_training ` and :ref:`dnnl_forward_inference `. * - direction - RNN direction. See :ref:`dnnl_rnn_direction_t ` 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. * - flags - Unused. .. rubric:: Returns: :ref:`dnnl_success ` on success and a status describing the error otherwise. .. index:: pair: function; dnnl_lstm_backward_desc_init .. _doxid-group__dnnl__api__rnn_1ga61249b3a787ca3d6412daf7fa389f8cd: .. ref-code-block:: cpp :class: doxyrest-title-code-block :ref:`dnnl_status_t` DNNL_API dnnl_lstm_backward_desc_init( :ref:`dnnl_rnn_desc_t`* rnn_desc, :ref:`dnnl_prop_kind_t` prop_kind, :ref:`dnnl_rnn_direction_t` direction, const :ref:`dnnl_memory_desc_t`* src_layer_desc, const :ref:`dnnl_memory_desc_t`* src_iter_desc, const :ref:`dnnl_memory_desc_t`* src_iter_c_desc, const :ref:`dnnl_memory_desc_t`* weights_layer_desc, const :ref:`dnnl_memory_desc_t`* weights_iter_desc, const :ref:`dnnl_memory_desc_t`* bias_desc, const :ref:`dnnl_memory_desc_t`* dst_layer_desc, const :ref:`dnnl_memory_desc_t`* dst_iter_desc, const :ref:`dnnl_memory_desc_t`* dst_iter_c_desc, const :ref:`dnnl_memory_desc_t`* diff_src_layer_desc, const :ref:`dnnl_memory_desc_t`* diff_src_iter_desc, const :ref:`dnnl_memory_desc_t`* diff_src_iter_c_desc, const :ref:`dnnl_memory_desc_t`* diff_weights_layer_desc, const :ref:`dnnl_memory_desc_t`* diff_weights_iter_desc, const :ref:`dnnl_memory_desc_t`* diff_bias_desc, const :ref:`dnnl_memory_desc_t`* diff_dst_layer_desc, const :ref:`dnnl_memory_desc_t`* diff_dst_iter_desc, const :ref:`dnnl_memory_desc_t`* diff_dst_iter_c_desc, unsigned flags ) Initializes a descriptor for an LSTM backward propagation primitive. The following arguments may either be ``NULL`` or 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. .. note:: All memory descriptors can be initialized with :ref:`dnnl_format_tag_any ` or with format_kind set to :ref:`dnnl_format_kind_any `. .. rubric:: Parameters: .. list-table:: :widths: 20 80 * - rnn_desc - Output descriptor for LSTM primitive. * - prop_kind - Propagation kind. Must be :ref:`dnnl_backward `. * - direction - RNN direction. See :ref:`dnnl_rnn_direction_t ` 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. * - flags - Unused. .. rubric:: Returns: :ref:`dnnl_success ` on success and a status describing the error otherwise. .. rubric:: See also: :ref:`dnnl_lstm_backward_desc_init_v2 ` to initialize backward LSTM with and without peephole :ref:`dnnl_lstm_backward_desc_init_v3 ` to initialize backward LSTM with and without peephole / recurrent projection layer .. index:: pair: function; dnnl_lstm_backward_desc_init_v2 .. _doxid-group__dnnl__api__rnn_1ga893994f53b35e6d66bd346a0ee1936a7: .. ref-code-block:: cpp :class: doxyrest-title-code-block :ref:`dnnl_status_t` DNNL_API dnnl_lstm_backward_desc_init_v2( :ref:`dnnl_rnn_desc_t`* rnn_desc, :ref:`dnnl_prop_kind_t` prop_kind, :ref:`dnnl_rnn_direction_t` direction, const :ref:`dnnl_memory_desc_t`* src_layer_desc, const :ref:`dnnl_memory_desc_t`* src_iter_desc, const :ref:`dnnl_memory_desc_t`* src_iter_c_desc, const :ref:`dnnl_memory_desc_t`* weights_layer_desc, const :ref:`dnnl_memory_desc_t`* weights_iter_desc, const :ref:`dnnl_memory_desc_t`* weights_peephole_desc, const :ref:`dnnl_memory_desc_t`* bias_desc, const :ref:`dnnl_memory_desc_t`* dst_layer_desc, const :ref:`dnnl_memory_desc_t`* dst_iter_desc, const :ref:`dnnl_memory_desc_t`* dst_iter_c_desc, const :ref:`dnnl_memory_desc_t`* diff_src_layer_desc, const :ref:`dnnl_memory_desc_t`* diff_src_iter_desc, const :ref:`dnnl_memory_desc_t`* diff_src_iter_c_desc, const :ref:`dnnl_memory_desc_t`* diff_weights_layer_desc, const :ref:`dnnl_memory_desc_t`* diff_weights_iter_desc, const :ref:`dnnl_memory_desc_t`* diff_weights_peephole_desc, const :ref:`dnnl_memory_desc_t`* diff_bias_desc, const :ref:`dnnl_memory_desc_t`* diff_dst_layer_desc, const :ref:`dnnl_memory_desc_t`* diff_dst_iter_desc, const :ref:`dnnl_memory_desc_t`* diff_dst_iter_c_desc, unsigned flags ) Initializes a descriptor for an LSTM (with or without peephole) backward propagation primitive. The following arguments may either be ``NULL`` or 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. .. note:: All memory descriptors can be initialized with :ref:`dnnl_format_tag_any ` or with format_kind set to :ref:`dnnl_format_kind_any `. .. rubric:: Parameters: .. list-table:: :widths: 20 80 * - rnn_desc - Output descriptor for LSTM primitive. * - prop_kind - Propagation kind. Must be :ref:`dnnl_backward `. * - direction - RNN direction. See :ref:`dnnl_rnn_direction_t ` 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. * - flags - Unused. .. rubric:: Returns: :ref:`dnnl_success ` on success and a status describing the error otherwise. .. rubric:: See also: :ref:`dnnl_lstm_backward_desc_init_v3 ` to initialize backward LSTM with and without peephole / recurrent projection layer .. index:: pair: function; dnnl_lstm_backward_desc_init_v3 .. _doxid-group__dnnl__api__rnn_1ga7a04fe20c7cc0efe2728433aebfdef52: .. ref-code-block:: cpp :class: doxyrest-title-code-block :ref:`dnnl_status_t` DNNL_API dnnl_lstm_backward_desc_init_v3( :ref:`dnnl_rnn_desc_t`* rnn_desc, :ref:`dnnl_prop_kind_t` prop_kind, :ref:`dnnl_rnn_direction_t` direction, const :ref:`dnnl_memory_desc_t`* src_layer_desc, const :ref:`dnnl_memory_desc_t`* src_iter_desc, const :ref:`dnnl_memory_desc_t`* src_iter_c_desc, const :ref:`dnnl_memory_desc_t`* weights_layer_desc, const :ref:`dnnl_memory_desc_t`* weights_iter_desc, const :ref:`dnnl_memory_desc_t`* weights_peephole_desc, const :ref:`dnnl_memory_desc_t`* weights_projection_desc, const :ref:`dnnl_memory_desc_t`* bias_desc, const :ref:`dnnl_memory_desc_t`* dst_layer_desc, const :ref:`dnnl_memory_desc_t`* dst_iter_desc, const :ref:`dnnl_memory_desc_t`* dst_iter_c_desc, const :ref:`dnnl_memory_desc_t`* diff_src_layer_desc, const :ref:`dnnl_memory_desc_t`* diff_src_iter_desc, const :ref:`dnnl_memory_desc_t`* diff_src_iter_c_desc, const :ref:`dnnl_memory_desc_t`* diff_weights_layer_desc, const :ref:`dnnl_memory_desc_t`* diff_weights_iter_desc, const :ref:`dnnl_memory_desc_t`* diff_weights_peephole_desc, const :ref:`dnnl_memory_desc_t`* diff_weights_projection_desc, const :ref:`dnnl_memory_desc_t`* diff_bias_desc, const :ref:`dnnl_memory_desc_t`* diff_dst_layer_desc, const :ref:`dnnl_memory_desc_t`* diff_dst_iter_desc, const :ref:`dnnl_memory_desc_t`* diff_dst_iter_c_desc, unsigned flags ) Initializes a descriptor for an LSTM (with or without peephole and with or with out recurrent projection layer) backward propagation primitive. The following arguments may either be ``NULL`` or 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`` could either be ``NULL`` or point to a zero memory descriptor. This would then indicate that the LSTM doesn't have recurrent projection layer. .. note:: All memory descriptors can be initialized with :ref:`dnnl_format_tag_any ` or with format_kind set to :ref:`dnnl_format_kind_any `. .. rubric:: Parameters: .. list-table:: :widths: 20 80 * - rnn_desc - Output descriptor for LSTM primitive. * - prop_kind - Propagation kind. Must be :ref:`dnnl_backward `. * - direction - RNN direction. See :ref:`dnnl_rnn_direction_t ` 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. * - flags - Unused. .. rubric:: Returns: :ref:`dnnl_success ` on success and a status describing the error otherwise. .. index:: pair: function; dnnl_gru_forward_desc_init .. _doxid-group__dnnl__api__rnn_1ga1552168adfd901681cc6eab2d6da4112: .. ref-code-block:: cpp :class: doxyrest-title-code-block :ref:`dnnl_status_t` DNNL_API dnnl_gru_forward_desc_init( :ref:`dnnl_rnn_desc_t`* rnn_desc, :ref:`dnnl_prop_kind_t` prop_kind, :ref:`dnnl_rnn_direction_t` direction, const :ref:`dnnl_memory_desc_t`* src_layer_desc, const :ref:`dnnl_memory_desc_t`* src_iter_desc, const :ref:`dnnl_memory_desc_t`* weights_layer_desc, const :ref:`dnnl_memory_desc_t`* weights_iter_desc, const :ref:`dnnl_memory_desc_t`* bias_desc, const :ref:`dnnl_memory_desc_t`* dst_layer_desc, const :ref:`dnnl_memory_desc_t`* dst_iter_desc, unsigned flags ) Initializes a descriptor for GRU forward propagation primitive. The following arguments may either be ``NULL`` or point to a zero memory descriptor: * ``src_iter_desc``, * ``bias_desc``, * ``dst_iter_desc``. This would then indicate that the GRU forward propagation primitive should not use them and should default to zero values instead. .. note:: All memory descriptors can be initialized with :ref:`dnnl_format_tag_any ` or with format_kind set to :ref:`dnnl_format_kind_any `. .. rubric:: Parameters: .. list-table:: :widths: 20 80 * - rnn_desc - Output descriptor for GRU primitive. * - prop_kind - Propagation kind. Possible values are :ref:`dnnl_forward_training ` and :ref:`dnnl_forward_inference `. * - direction - RNN direction. See :ref:`dnnl_rnn_direction_t ` for more info. * - src_layer_desc - Memory descriptor for the input vector. * - src_iter_desc - Memory descriptor for the input recurrent hidden 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. * - flags - Unused. .. rubric:: Returns: :ref:`dnnl_success ` on success and a status describing the error otherwise. .. index:: pair: function; dnnl_gru_backward_desc_init .. _doxid-group__dnnl__api__rnn_1gaed7f10aace5ff7a268e33150908d2d67: .. ref-code-block:: cpp :class: doxyrest-title-code-block :ref:`dnnl_status_t` DNNL_API dnnl_gru_backward_desc_init( :ref:`dnnl_rnn_desc_t`* rnn_desc, :ref:`dnnl_prop_kind_t` prop_kind, :ref:`dnnl_rnn_direction_t` direction, const :ref:`dnnl_memory_desc_t`* src_layer_desc, const :ref:`dnnl_memory_desc_t`* src_iter_desc, const :ref:`dnnl_memory_desc_t`* weights_layer_desc, const :ref:`dnnl_memory_desc_t`* weights_iter_desc, const :ref:`dnnl_memory_desc_t`* bias_desc, const :ref:`dnnl_memory_desc_t`* dst_layer_desc, const :ref:`dnnl_memory_desc_t`* dst_iter_desc, const :ref:`dnnl_memory_desc_t`* diff_src_layer_desc, const :ref:`dnnl_memory_desc_t`* diff_src_iter_desc, const :ref:`dnnl_memory_desc_t`* diff_weights_layer_desc, const :ref:`dnnl_memory_desc_t`* diff_weights_iter_desc, const :ref:`dnnl_memory_desc_t`* diff_bias_desc, const :ref:`dnnl_memory_desc_t`* diff_dst_layer_desc, const :ref:`dnnl_memory_desc_t`* diff_dst_iter_desc, unsigned flags ) Initializes a descriptor for GRU backward propagation primitive. The following arguments may either be ``NULL`` or point to a zero memory descriptor: * ``src_iter_desc`` together with ``diff_src_iter_desc``, * ``bias_desc`` together with ``diff_bias_desc``, * ``dst_iter_desc`` together with ``diff_dst_iter_desc``. This would then indicate that the GRU backward propagation primitive should not use them and should default to zero values instead. .. note:: All memory descriptors can be initialized with :ref:`dnnl_format_tag_any ` or with format_kind set to :ref:`dnnl_format_kind_any `. .. rubric:: Parameters: .. list-table:: :widths: 20 80 * - rnn_desc - Output descriptor for GRU primitive. * - prop_kind - Propagation kind. Must be :ref:`dnnl_backward `. * - direction - RNN direction. See :ref:`dnnl_rnn_direction_t ` for more info. * - src_layer_desc - Memory descriptor for the input vector. * - src_iter_desc - Memory descriptor for the input recurrent hidden 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. * - 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_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. * - flags - Unused. .. rubric:: Returns: :ref:`dnnl_success ` on success and a status describing the error otherwise. .. index:: pair: function; dnnl_lbr_gru_forward_desc_init .. _doxid-group__dnnl__api__rnn_1gac60139476aa94b994c4007a715899283: .. ref-code-block:: cpp :class: doxyrest-title-code-block :ref:`dnnl_status_t` DNNL_API dnnl_lbr_gru_forward_desc_init( :ref:`dnnl_rnn_desc_t`* rnn_desc, :ref:`dnnl_prop_kind_t` prop_kind, :ref:`dnnl_rnn_direction_t` direction, const :ref:`dnnl_memory_desc_t`* src_layer_desc, const :ref:`dnnl_memory_desc_t`* src_iter_desc, const :ref:`dnnl_memory_desc_t`* weights_layer_desc, const :ref:`dnnl_memory_desc_t`* weights_iter_desc, const :ref:`dnnl_memory_desc_t`* bias_desc, const :ref:`dnnl_memory_desc_t`* dst_layer_desc, const :ref:`dnnl_memory_desc_t`* dst_iter_desc, unsigned flags ) Initializes a descriptor for LBR GRU forward propagation primitive. The following arguments may either be ``NULL`` or point to a zero memory descriptor: * ``src_iter_desc``, * ``bias_desc``, * ``dst_iter_desc``. This would then indicate that the LBR GRU forward propagation primitive should not use them and should default to zero values instead. .. rubric:: Parameters: .. list-table:: :widths: 20 80 * - rnn_desc - Output descriptor for LBR GRU primitive. * - prop_kind - Propagation kind. Possible values are :ref:`dnnl_forward_training ` and :ref:`dnnl_forward_inference `. * - direction - RNN direction. See :ref:`dnnl_rnn_direction_t ` for more info. * - src_layer_desc - Memory descriptor for the input vector. * - src_iter_desc - Memory descriptor for the input recurrent hidden 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. * - flags - Unused. .. rubric:: Returns: :ref:`dnnl_success ` on success and a status describing the error otherwise. .. index:: pair: function; dnnl_lbr_gru_backward_desc_init .. _doxid-group__dnnl__api__rnn_1ga051e03160540be590513bee961edd2c4: .. ref-code-block:: cpp :class: doxyrest-title-code-block :ref:`dnnl_status_t` DNNL_API dnnl_lbr_gru_backward_desc_init( :ref:`dnnl_rnn_desc_t`* rnn_desc, :ref:`dnnl_prop_kind_t` prop_kind, :ref:`dnnl_rnn_direction_t` direction, const :ref:`dnnl_memory_desc_t`* src_layer_desc, const :ref:`dnnl_memory_desc_t`* src_iter_desc, const :ref:`dnnl_memory_desc_t`* weights_layer_desc, const :ref:`dnnl_memory_desc_t`* weights_iter_desc, const :ref:`dnnl_memory_desc_t`* bias_desc, const :ref:`dnnl_memory_desc_t`* dst_layer_desc, const :ref:`dnnl_memory_desc_t`* dst_iter_desc, const :ref:`dnnl_memory_desc_t`* diff_src_layer_desc, const :ref:`dnnl_memory_desc_t`* diff_src_iter_desc, const :ref:`dnnl_memory_desc_t`* diff_weights_layer_desc, const :ref:`dnnl_memory_desc_t`* diff_weights_iter_desc, const :ref:`dnnl_memory_desc_t`* diff_bias_desc, const :ref:`dnnl_memory_desc_t`* diff_dst_layer_desc, const :ref:`dnnl_memory_desc_t`* diff_dst_iter_desc, unsigned flags ) Initializes a descriptor for LBR GRU backward propagation primitive. The following arguments may either be ``NULL`` or point to a zero memory descriptor: * ``src_iter_desc`` together with ``diff_src_iter_desc``, * ``bias_desc`` together with ``diff_bias_desc``, * ``dst_iter_desc`` together with ``diff_dst_iter_desc``. This would then indicate that the LBR GRU backward propagation primitive should not use them and should default to zero values instead. .. note:: All memory descriptors can be initialized with :ref:`dnnl_format_tag_any ` or with format_kind set to :ref:`dnnl_format_kind_any `. .. rubric:: Parameters: .. list-table:: :widths: 20 80 * - rnn_desc - Output descriptor for LBR GRU primitive. * - prop_kind - Propagation kind. Must be :ref:`dnnl_backward `. * - direction - RNN direction. See :ref:`dnnl_rnn_direction_t ` for more info. * - src_layer_desc - Memory descriptor for the input vector. * - src_iter_desc - Memory descriptor for the input recurrent hidden 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. * - 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_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. * - flags - Unused. .. rubric:: Returns: :ref:`dnnl_success ` on success and a status describing the error otherwise.