# tf.contrib.cudnn_rnn.CudnnParamsFormatConverterGRU

<br />

|---|
| [![](https://www.tensorflow.org/images/GitHub-Mark-32px.png) View source on GitHub](https://github.com/tensorflow/tensorflow/blob/v1.15.0/tensorflow/contrib/cudnn_rnn/python/ops/cudnn_rnn_ops.py#L584-L658) |

Helper class that converts between params of Cudnn and TF GRU.

    tf.contrib.cudnn_rnn.CudnnParamsFormatConverterGRU(
        num_layers, num_units, input_size, num_proj=None,
        input_mode=CUDNN_INPUT_LINEAR_MODE, direction=CUDNN_RNN_UNIDIRECTION
    )

<br />

<br />

<br />

| ## Args ||
|---|---|
| `num_layers` | the number of layers for the RNN model. |
| `num_units` | the number of units within the RNN model. |
| `input_size` | the size of the input, it could be different from the num_units. |
| `num_proj` | The output dimensionality for the projection matrices. If None or 0, no projection is performed. |
| `input_mode` | indicate whether there is a linear projection between the input and the actual computation before the first layer. It could be one of 'linear_input', 'skip_input' or 'auto_select'. \* 'linear_input' (default) always applies a linear projection of input onto RNN hidden state. (standard RNN behavior). \* 'skip_input' is only allowed when input_size == num_units; \* 'auto_select' implies 'skip_input' when input_size == num_units; otherwise, it implies 'linear_input'. |
| `direction` | the direction model that the model operates. Could be either 'unidirectional' or 'bidirectional' |

<br />

## Methods

### `opaque_to_tf_canonical`

[View source](https://github.com/tensorflow/tensorflow/blob/v1.15.0/tensorflow/contrib/cudnn_rnn/python/ops/cudnn_rnn_ops.py#L230-L240)

    opaque_to_tf_canonical(
        opaque_param
    )

Converts cudnn opaque param to tf canonical weights.

### `tf_canonical_to_opaque`

[View source](https://github.com/tensorflow/tensorflow/blob/v1.15.0/tensorflow/contrib/cudnn_rnn/python/ops/cudnn_rnn_ops.py#L222-L228)

    tf_canonical_to_opaque(
        tf_canonicals, weights_proj=None
    )

Converts tf canonical weights to cudnn opaque param.