TF 2.0 is out! Get hands-on practice at TF World, Oct 28-31. Use code TF20 for 20% off select passes. Register now

tf.contrib.cudnn_rnn.CudnnParamsFormatConverterGRU

View source on GitHub

Class CudnnParamsFormatConverterGRU

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

__init__

View source

__init__(
    num_layers,
    num_units,
    input_size,
    input_mode=CUDNN_INPUT_LINEAR_MODE,
    direction=CUDNN_RNN_UNIDIRECTION
)

Constructor.

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.
  • 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'

Methods

opaque_to_tf_canonical

View source

opaque_to_tf_canonical(opaque_param)

Converts cudnn opaque param to tf canonical weights.

tf_canonical_to_opaque

View source

tf_canonical_to_opaque(tf_canonicals)

Converts tf canonical weights to cudnn opaque param.