tf.raw_ops.CudnnRNNBackpropV3
Stay organized with collections
Save and categorize content based on your preferences.
Backprop step of CudnnRNNV3.
tf.raw_ops.CudnnRNNBackpropV3(
input,
input_h,
input_c,
params,
sequence_lengths,
output,
output_h,
output_c,
output_backprop,
output_h_backprop,
output_c_backprop,
reserve_space,
host_reserved,
rnn_mode='lstm',
input_mode='linear_input',
direction='unidirectional',
dropout=0,
seed=0,
seed2=0,
num_proj=0,
time_major=True,
name=None
)
Compute the backprop of both data and weights in a RNN. Takes an extra
"sequence_lengths" input than CudnnRNNBackprop.
rnn_mode: Indicates the type of the RNN model.
input_mode: Indicates 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: If time_major is true, this is a 3-D tensor with the shape of
[seq_length, batch_size, input_size]. If time_major is false, the shape is
[batch_size, seq_length, input_size].
input_h: If time_major is true, this is a 3-D tensor with the shape of
[num_layer * dir, batch_size, num_units]. If time_major is false, the shape
is [batch_size, num_layer * dir, 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
sequence_lengths: a vector of lengths of each input sequence.
output: If time_major is true, this is a 3-D tensor with the shape of
[seq_length, batch_size, dir * num_units]. If time_major is false, the
shape is [batch_size, seq_length, 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.
output_backprop: A 3-D tensor with the same shape as output in the forward pass.
output_h_backprop: A 3-D tensor with the same shape as output_h in the forward
pass.
output_c_backprop: A 3-D tensor with the same shape as output_c in the forward
pass.
time_major: Indicates whether the input/output format is time major or batch
major.
reserve_space: The same reserve_space produced in the forward operation.
input_backprop: The backprop to input in the forward pass. Has the same shape
as input.
input_h_backprop: The backprop to input_h in the forward pass. Has the same
shape as input_h.
input_c_backprop: The backprop to input_c in the forward pass. Has the same
shape as input_c.
params_backprop: The backprop to the params buffer in the forward pass. Has the
same shape as params.
Args |
input
|
A Tensor . Must be one of the following types: bfloat16 , 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 .
|
sequence_lengths
|
A Tensor of type int32 .
|
output
|
A Tensor . Must have the same type as input .
|
output_h
|
A Tensor . Must have the same type as input .
|
output_c
|
A Tensor . Must have the same type as input .
|
output_backprop
|
A Tensor . Must have the same type as input .
|
output_h_backprop
|
A Tensor . Must have the same type as input .
|
output_c_backprop
|
A Tensor . Must have the same type as input .
|
reserve_space
|
A Tensor . Must have the same type as input .
|
host_reserved
|
A Tensor of type int8 .
|
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 .
|
num_proj
|
An optional int . Defaults to 0 .
|
time_major
|
An optional bool . Defaults to True .
|
name
|
A name for the operation (optional).
|
Returns |
A tuple of Tensor objects (input_backprop, input_h_backprop, input_c_backprop, params_backprop).
|
input_backprop
|
A Tensor . Has the same type as input .
|
input_h_backprop
|
A Tensor . Has the same type as input .
|
input_c_backprop
|
A Tensor . Has the same type as input .
|
params_backprop
|
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 2023-10-06 UTC.
[null,null,["Last updated 2023-10-06 UTC."],[],[],null,["# tf.raw_ops.CudnnRNNBackpropV3\n\n\u003cbr /\u003e\n\nBackprop step of CudnnRNNV3.\n\n#### View aliases\n\n\n**Compat aliases for migration**\n\nSee\n[Migration guide](https://www.tensorflow.org/guide/migrate) for\nmore details.\n\n[`tf.compat.v1.raw_ops.CudnnRNNBackpropV3`](https://www.tensorflow.org/api_docs/python/tf/raw_ops/CudnnRNNBackpropV3)\n\n\u003cbr /\u003e\n\n tf.raw_ops.CudnnRNNBackpropV3(\n input,\n input_h,\n input_c,\n params,\n sequence_lengths,\n output,\n output_h,\n output_c,\n output_backprop,\n output_h_backprop,\n output_c_backprop,\n reserve_space,\n host_reserved,\n rnn_mode='lstm',\n input_mode='linear_input',\n direction='unidirectional',\n dropout=0,\n seed=0,\n seed2=0,\n num_proj=0,\n time_major=True,\n name=None\n )\n\nCompute the backprop of both data and weights in a RNN. Takes an extra\n\"sequence_lengths\" input than CudnnRNNBackprop.\n\nrnn_mode: Indicates the type of the RNN model.\ninput_mode: Indicates whether there is a linear projection between the input and\nthe actual computation before the first layer. 'skip_input' is only allowed\nwhen input_size == num_units; 'auto_select' implies 'skip_input' when\ninput_size == num_units; otherwise, it implies 'linear_input'.\ndirection: Indicates whether a bidirectional model will be used. Should be\n\"unidirectional\" or \"bidirectional\".\ndropout: Dropout probability. When set to 0., dropout is disabled.\nseed: The 1st part of a seed to initialize dropout.\nseed2: The 2nd part of a seed to initialize dropout.\ninput: If time_major is true, this is a 3-D tensor with the shape of\n\\[seq_length, batch_size, input_size\\]. If time_major is false, the shape is\n\\[batch_size, seq_length, input_size\\].\ninput_h: If time_major is true, this is a 3-D tensor with the shape of\n\\[num_layer \\* dir, batch_size, num_units\\]. If time_major is false, the shape\nis \\[batch_size, num_layer \\* dir, num_units\\].\ninput_c: For LSTM, a 3-D tensor with the shape of\n\\[num_layer \\* dir, batch, num_units\\]. For other models, it is ignored.\nparams: A 1-D tensor that contains the weights and biases in an opaque layout.\nThe size must be created through CudnnRNNParamsSize, and initialized\nseparately. Note that they might not be compatible across different\ngenerations. So it is a good idea to save and restore\nsequence_lengths: a vector of lengths of each input sequence.\noutput: If time_major is true, this is a 3-D tensor with the shape of\n\\[seq_length, batch_size, dir \\* num_units\\]. If time_major is false, the\nshape is \\[batch_size, seq_length, dir \\* num_units\\].\noutput_h: The same shape has input_h.\noutput_c: The same shape as input_c for LSTM. An empty tensor for other models.\noutput_backprop: A 3-D tensor with the same shape as output in the forward pass.\noutput_h_backprop: A 3-D tensor with the same shape as output_h in the forward\npass.\noutput_c_backprop: A 3-D tensor with the same shape as output_c in the forward\npass.\ntime_major: Indicates whether the input/output format is time major or batch\nmajor.\nreserve_space: The same reserve_space produced in the forward operation.\ninput_backprop: The backprop to input in the forward pass. Has the same shape\nas input.\ninput_h_backprop: The backprop to input_h in the forward pass. Has the same\nshape as input_h.\ninput_c_backprop: The backprop to input_c in the forward pass. Has the same\nshape as input_c.\nparams_backprop: The backprop to the params buffer in the forward pass. Has the\nsame shape as params.\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n| Args ---- ||\n|---------------------|---------------------------------------------------------------------------------------------------------|\n| `input` | A `Tensor`. Must be one of the following types: `bfloat16`, `half`, `float32`, `float64`. |\n| `input_h` | A `Tensor`. Must have the same type as `input`. |\n| `input_c` | A `Tensor`. Must have the same type as `input`. |\n| `params` | A `Tensor`. Must have the same type as `input`. |\n| `sequence_lengths` | A `Tensor` of type `int32`. |\n| `output` | A `Tensor`. Must have the same type as `input`. |\n| `output_h` | A `Tensor`. Must have the same type as `input`. |\n| `output_c` | A `Tensor`. Must have the same type as `input`. |\n| `output_backprop` | A `Tensor`. Must have the same type as `input`. |\n| `output_h_backprop` | A `Tensor`. Must have the same type as `input`. |\n| `output_c_backprop` | A `Tensor`. Must have the same type as `input`. |\n| `reserve_space` | A `Tensor`. Must have the same type as `input`. |\n| `host_reserved` | A `Tensor` of type `int8`. |\n| `rnn_mode` | An optional `string` from: `\"rnn_relu\", \"rnn_tanh\", \"lstm\", \"gru\"`. Defaults to `\"lstm\"`. |\n| `input_mode` | An optional `string` from: `\"linear_input\", \"skip_input\", \"auto_select\"`. Defaults to `\"linear_input\"`. |\n| `direction` | An optional `string` from: `\"unidirectional\", \"bidirectional\"`. Defaults to `\"unidirectional\"`. |\n| `dropout` | An optional `float`. Defaults to `0`. |\n| `seed` | An optional `int`. Defaults to `0`. |\n| `seed2` | An optional `int`. Defaults to `0`. |\n| `num_proj` | An optional `int`. Defaults to `0`. |\n| `time_major` | An optional `bool`. Defaults to `True`. |\n| `name` | A name for the operation (optional). |\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n| Returns ------- ||\n|--------------------|-------------------------------------------|\n| A tuple of `Tensor` objects (input_backprop, input_h_backprop, input_c_backprop, params_backprop). ||\n| `input_backprop` | A `Tensor`. Has the same type as `input`. |\n| `input_h_backprop` | A `Tensor`. Has the same type as `input`. |\n| `input_c_backprop` | A `Tensor`. Has the same type as `input`. |\n| `params_backprop` | A `Tensor`. Has the same type as `input`. |\n\n\u003cbr /\u003e"]]