## RNNSequence {#openvino_docs_ops_sequence_RNNSequence_4} **Versioned name**: *RNNSequence-4* **Category**: *Sequence processing* **Short description**: *RNNSequence* operation represents a series of RNN cells. Each cell is implemented as RNNCell operation. **Detailed description** A single cell in the sequence is implemented in the same way as in RNNCell operation. *RNNSequence* represents a sequence of RNN cells. The sequence can be connected differently depending on `direction` attribute that specifies the direction of traversing of input data along sequence dimension or specifies whether it should be a bidirectional sequence. The most of the attributes are in sync with the specification of ONNX RNN operator defined RNNCell. **Attributes** * *hidden_size* * **Description**: *hidden_size* specifies hidden state size. * **Range of values**: a positive integer * **Type**: `int` * **Default value**: None * **Required**: *yes* * *activations* * **Description**: activation functions for gates * **Range of values**: any combination of *relu*, *sigmoid*, *tanh* * **Type**: a list of strings * **Default value**: *tanh* * **Required**: *no* * *activations_alpha, activations_beta* * **Description**: *activations_alpha, activations_beta* attributes of functions; applicability and meaning of these attributes depends on choosen activation functions * **Range of values**: a list of floating-point numbers * **Type**: `float[]` * **Default value**: None * **Required**: *no* * *clip* * **Description**: *clip* specifies bound values *[-C, C]* for tensor clipping. Clipping is performed before activations. * **Range of values**: a positive floating-point number * **Type**: `float` * **Default value**: *infinity* that means that the clipping is not applied * **Required**: *no* * *direction* * **Description**: Specify if the RNN is forward, reverse, or bidirectional. If it is one of *forward* or *reverse* then `num_directions = 1`, if it is *bidirectional*, then `num_directions = 2`. This `num_directions` value specifies input/output shape requirements. * **Range of values**: *forward*, *reverse*, *bidirectional* * **Type**: `string` * **Default value**: None * **Required**: *Yes* **Inputs** * **1**: `X` - 3D tensor of type *T1* `[batch_size, seq_length, input_size]`, input data. It differs from RNNCell 1st input only by additional axis with size `seq_length`. **Required.** * **2**: `initial_hidden_state` - 3D tensor of type *T1* `[batch_size, num_directions, hidden_size]`, input hidden state data. **Required.** * **3**: `sequence_lengths` - 1D tensor of type *T2* `[batch_size]`, specifies real sequence lengths for each batch element. **Required.** * **4**: `W` - 3D tensor of type *T1* `[num_directions, hidden_size, input_size]`, the weights for matrix multiplication. **Required.** * **5**: `R` - 3D tensor of type *T1* `[num_directions, hidden_size, hidden_size]`, the recurrence weights for matrix multiplication. **Required.** * **6**: `B` - 2D tensor of type *T1* `[num_directions, hidden_size]`, the sum of biases (weights and recurrence weights). **Required.** **Outputs** * **1**: `Y` – 3D tensor of type *T1* `[batch_size, num_directions, seq_len, hidden_size]`, concatenation of all the intermediate output values of the hidden. * **2**: `Ho` - 3D tensor of type *T1* `[batch_size, num_directions, hidden_size]`, the last output value of hidden state. **Types** * *T1*: any supported floating point type. * *T2*: any supported integer type. **Example** ```xml 1 4 16 1 1 128 1 1 128 16 1 128 128 1 128 1 1 4 128 1 1 128 ```