struct dnnl_rnn_desc_t

Overview

A descriptor for an RNN operation. More…

#include <dnnl_types.h>

struct dnnl_rnn_desc_t
{
    // fields

    dnnl_primitive_kind_t primitive_kind;
    dnnl_prop_kind_t prop_kind;
    dnnl_alg_kind_t cell_kind;
    dnnl_rnn_direction_t direction;
    dnnl_memory_desc_t src_layer_desc;
    dnnl_memory_desc_t src_iter_desc;
    dnnl_memory_desc_t src_iter_c_desc;
    dnnl_memory_desc_t weights_layer_desc;
    dnnl_memory_desc_t weights_iter_desc;
    dnnl_memory_desc_t bias_desc;
    dnnl_memory_desc_t dst_layer_desc;
    dnnl_memory_desc_t dst_iter_desc;
    dnnl_memory_desc_t dst_iter_c_desc;
    dnnl_memory_desc_t weights_peephole_desc;
    dnnl_memory_desc_t weights_projection_desc;
    dnnl_memory_desc_t diff_src_layer_desc;
    dnnl_memory_desc_t diff_src_iter_desc;
    dnnl_memory_desc_t diff_src_iter_c_desc;
    dnnl_memory_desc_t diff_weights_layer_desc;
    dnnl_memory_desc_t diff_weights_iter_desc;
    dnnl_memory_desc_t diff_bias_desc;
    dnnl_memory_desc_t diff_dst_layer_desc;
    dnnl_memory_desc_t diff_dst_iter_desc;
    dnnl_memory_desc_t diff_dst_iter_c_desc;
    dnnl_memory_desc_t diff_weights_peephole_desc;
    dnnl_memory_desc_t diff_weights_projection_desc;
    unsigned int flags;
    dnnl_alg_kind_t activation_kind;
    float alpha;
    float beta;
};

Detailed Documentation

A descriptor for an RNN operation.

Fields

dnnl_primitive_kind_t primitive_kind

The kind of primitive.

Used for self-identifying the primitive descriptor. Must be dnnl_rnn.

dnnl_prop_kind_t prop_kind

The kind of propagation.

Possible values: dnnl_forward_training, dnnl_forward_inference, and dnnl_backward.

dnnl_alg_kind_t cell_kind

RNN cell kind.

Must be one of dnnl_vanilla_rnn, dnnl_vanilla_lstm, dnnl_vanilla_gru, or dnnl_lbr_gru.

dnnl_rnn_direction_t direction

The direction of RNN primitive execution.

dnnl_memory_desc_t src_layer_desc

Source layer memory descriptor.

dnnl_memory_desc_t src_iter_desc

Source iteration memory descriptor for hidden state.

dnnl_memory_desc_t src_iter_c_desc

Source iteration memory descriptor for cell state.

dnnl_memory_desc_t weights_layer_desc

Weights layer memory descriptor.

dnnl_memory_desc_t weights_iter_desc

Weights iteration memory descriptor.

dnnl_memory_desc_t bias_desc

Bias memory descriptor.

dnnl_memory_desc_t dst_layer_desc

Destination layer memory descriptor.

dnnl_memory_desc_t dst_iter_desc

Destination iter memory descriptor for hidden state.

dnnl_memory_desc_t dst_iter_c_desc

Destination iter memory descriptor for cell state.

dnnl_memory_desc_t weights_peephole_desc

Weights peephole memory descriptor.

This memory descriptor is equal to zero memory descriptor in case of non-peephole LSTMs and other non-LSTM RNNs.

dnnl_memory_desc_t weights_projection_desc

Weights projection memory descriptor.

This memory descriptor is equal to zero memory descriptor in case of non-projection LSTMs and other non-LSTM RNNs.

dnnl_memory_desc_t diff_src_layer_desc

Source gradient layer memory descriptor.

dnnl_memory_desc_t diff_src_iter_desc

Source gradient iter memory descriptor for hidden state.

dnnl_memory_desc_t diff_src_iter_c_desc

Source gradient iter memory descriptor for cell state.

dnnl_memory_desc_t diff_weights_layer_desc

Weights gradient layer memory descriptor.

dnnl_memory_desc_t diff_weights_iter_desc

Weights gradient iter memory descriptor.

dnnl_memory_desc_t diff_bias_desc

Bias gradient memory descriptor.

dnnl_memory_desc_t diff_dst_layer_desc

Destination gradient layer memory descriptor.

dnnl_memory_desc_t diff_dst_iter_desc

Destination gradient iteration memory descriptor for hidden state.

dnnl_memory_desc_t diff_dst_iter_c_desc

Destination gradient iteration memory descriptor for cell state.

dnnl_memory_desc_t diff_weights_peephole_desc

Weights gradient peephole memory descriptor.

This memory descriptor is equal to zero memory descriptor in case of non-peephole LSTMs and other non-LSTM RNNs.

dnnl_memory_desc_t diff_weights_projection_desc

Weights gradient projection memory descriptor.

This memory descriptor is equal to zero memory descriptor in case of non-projection LSTMs and other non-LSTM RNNs.

unsigned int flags

RNN cell flags.

dnnl_alg_kind_t activation_kind

Activation function used for vanilla_rnn cell kind.

Must be either dnnl_eltwise_relu or dnnl_eltwise_tanh.