tf.raw_ops.CudnnRNN
Stay organized with collections
Save and categorize content based on your preferences.
A RNN backed by cuDNN.
tf.raw_ops.CudnnRNN(
input,
input_h,
input_c,
params,
rnn_mode='lstm',
input_mode='linear_input',
direction='unidirectional',
dropout=0,
seed=0,
seed2=0,
is_training=True,
name=None
)
Computes the RNN from the input and initial states, with respect to the params
buffer.
rnn_mode: Indicates the type of the RNN model.
input_mode: Indicate whether there is a linear projection between the input and
the actual computation before the first layer. '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: Indicates whether a bidirectional model will be used. Should be
"unidirectional" or "bidirectional".
dropout: Dropout probability. When set to 0., dropout is disabled.
seed: The 1st part of a seed to initialize dropout.
seed2: The 2nd part of a seed to initialize dropout.
input: A 3-D tensor with the shape of [seq_length, batch_size, input_size].
input_h: A 3-D tensor with the shape of [num_layer * dir, batch_size,
num_units].
input_c: For LSTM, a 3-D tensor with the shape of
[num_layer * dir, batch, num_units]. For other models, it is ignored.
params: A 1-D tensor that contains the weights and biases in an opaque layout.
The size must be created through CudnnRNNParamsSize, and initialized
separately. Note that they might not be compatible across different
generations. So it is a good idea to save and restore
output: A 3-D tensor with the shape of [seq_length, batch_size,
dir * num_units].
output_h: The same shape has input_h.
output_c: The same shape as input_c for LSTM. An empty tensor for other models.
is_training: Indicates whether this operation is used for inference or
training.
reserve_space: An opaque tensor that can be used in backprop calculation. It
is only produced if is_training is false.
Args |
input
|
A Tensor . Must be one of the following types: half , float32 , float64 .
|
input_h
|
A Tensor . Must have the same type as input .
|
input_c
|
A Tensor . Must have the same type as input .
|
params
|
A Tensor . Must have the same type as input .
|
rnn_mode
|
An optional string from: "rnn_relu", "rnn_tanh", "lstm", "gru" . Defaults to "lstm" .
|
input_mode
|
An optional string from: "linear_input", "skip_input", "auto_select" . Defaults to "linear_input" .
|
direction
|
An optional string from: "unidirectional", "bidirectional" . Defaults to "unidirectional" .
|
dropout
|
An optional float . Defaults to 0 .
|
seed
|
An optional int . Defaults to 0 .
|
seed2
|
An optional int . Defaults to 0 .
|
is_training
|
An optional bool . Defaults to True .
|
name
|
A name for the operation (optional).
|
Returns |
A tuple of Tensor objects (output, output_h, output_c, reserve_space).
|
output
|
A Tensor . Has the same type as input .
|
output_h
|
A Tensor . Has the same type as input .
|
output_c
|
A Tensor . Has the same type as input .
|
reserve_space
|
A Tensor . Has the same type as input .
|
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates. Some content is licensed under the numpy license.
Last updated 2022-10-27 UTC.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2022-10-27 UTC."],[],[]]