struct dnnl::vanilla_rnn_forward::desc

Overview

Descriptor for a vanilla RNN forward propagation primitive. More…

#include <dnnl.hpp>

struct desc
{
    // fields

    dnnl_rnn_desc_t data;

    // construction

    desc(
        prop_kind aprop_kind,
        algorithm activation,
        rnn_direction direction,
        const memory::desc& src_layer_desc,
        const memory::desc& src_iter_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,
        rnn_flags flags = rnn_flags::undef,
        float alpha = 0.0f,
        float beta = 0.0f
        );
};

Detailed Documentation

Descriptor for a vanilla RNN forward propagation primitive.

Construction

desc(
    prop_kind aprop_kind,
    algorithm activation,
    rnn_direction direction,
    const memory::desc& src_layer_desc,
    const memory::desc& src_iter_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,
    rnn_flags flags = rnn_flags::undef,
    float alpha = 0.0f,
    float beta = 0.0f
    )

Constructs a descriptor for a vanilla RNN forward propagation primitive.

The following arguments may 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 except src_iter_desc can be initialized with an dnnl::memory::format_tag::any value of format_tag.

Parameters:

aprop_kind

Propagation kind. Possible values are dnnl::prop_kind::forward_training, and dnnl::prop_kind::forward_inference.

activation

Activation kind. Possible values are dnnl::algorithm::eltwise_relu, dnnl::algorithm::eltwise_tanh, or dnnl::algorithm::eltwise_logistic.

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.

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 dnnl::algorithm::eltwise_relu.

beta

Unused.