From aec495d6acdbdfac97ce91dd0782eb88e307c055 Mon Sep 17 00:00:00 2001 From: pengwa Date: Sat, 8 Sep 2018 11:20:23 +0800 Subject: [PATCH 1/4] add more ValueError description in dynamic_rnn document --- tensorflow/python/ops/rnn.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/tensorflow/python/ops/rnn.py b/tensorflow/python/ops/rnn.py index 5c00d929bf70ca..4f3d8c23181b6b 100644 --- a/tensorflow/python/ops/rnn.py +++ b/tensorflow/python/ops/rnn.py @@ -709,6 +709,10 @@ def _dynamic_rnn_loop(cell, Raises: ValueError: If the input depth cannot be inferred via shape inference from the inputs. + ValueError: If time is not the same for all the elements in the + input. + ValueError: If batch_size is not the same for all the elements + in the input. """ state = initial_state assert isinstance(parallel_iterations, int), "parallel_iterations must be int" From cfddd182f71147eaf5ee8dc50113de3c0e622655 Mon Sep 17 00:00:00 2001 From: pengwa Date: Mon, 10 Sep 2018 18:51:42 +0800 Subject: [PATCH 2/4] fix comments for _dynamic_rnn_loop and LSTMCell::call --- tensorflow/python/ops/rnn.py | 2 +- tensorflow/python/ops/rnn_cell_impl.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/tensorflow/python/ops/rnn.py b/tensorflow/python/ops/rnn.py index 4f3d8c23181b6b..259aca5a8191ba 100644 --- a/tensorflow/python/ops/rnn.py +++ b/tensorflow/python/ops/rnn.py @@ -709,7 +709,7 @@ def _dynamic_rnn_loop(cell, Raises: ValueError: If the input depth cannot be inferred via shape inference from the inputs. - ValueError: If time is not the same for all the elements in the + ValueError: If time_step is not the same for all the elements in the input. ValueError: If batch_size is not the same for all the elements in the input. diff --git a/tensorflow/python/ops/rnn_cell_impl.py b/tensorflow/python/ops/rnn_cell_impl.py index c11c9ccaae4381..3e19183ff5ccd4 100644 --- a/tensorflow/python/ops/rnn_cell_impl.py +++ b/tensorflow/python/ops/rnn_cell_impl.py @@ -954,7 +954,7 @@ def call(self, inputs, state): """Run one step of LSTM. Args: - inputs: input Tensor, 2D, `[batch, num_units]. + inputs: input Tensor, must be 2-D, `[batch, input_size]`. state: if `state_is_tuple` is False, this must be a state Tensor, `2-D, [batch, state_size]`. If `state_is_tuple` is True, this must be a tuple of state Tensors, both `2-D`, with column sizes `c_state` and From 4b0d12bb8c62a44e895ebd515c0145d1c18e9191 Mon Sep 17 00:00:00 2001 From: pengwa Date: Mon, 10 Sep 2018 18:54:52 +0800 Subject: [PATCH 3/4] minor format --- tensorflow/python/ops/rnn.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tensorflow/python/ops/rnn.py b/tensorflow/python/ops/rnn.py index 259aca5a8191ba..dcc17db632d5f4 100644 --- a/tensorflow/python/ops/rnn.py +++ b/tensorflow/python/ops/rnn.py @@ -711,8 +711,8 @@ def _dynamic_rnn_loop(cell, from the inputs. ValueError: If time_step is not the same for all the elements in the input. - ValueError: If batch_size is not the same for all the elements - in the input. + ValueError: If batch_size is not the same for all the elements in the + input. """ state = initial_state assert isinstance(parallel_iterations, int), "parallel_iterations must be int" From 6bbe31c5f5d42f646cb5080d955e9ee91bdb6d93 Mon Sep 17 00:00:00 2001 From: pengwa Date: Tue, 11 Sep 2018 09:05:12 +0800 Subject: [PATCH 4/4] fix typos --- tensorflow/python/ops/rnn.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tensorflow/python/ops/rnn.py b/tensorflow/python/ops/rnn.py index dcc17db632d5f4..5a3a5cc225bc60 100644 --- a/tensorflow/python/ops/rnn.py +++ b/tensorflow/python/ops/rnn.py @@ -710,9 +710,9 @@ def _dynamic_rnn_loop(cell, ValueError: If the input depth cannot be inferred via shape inference from the inputs. ValueError: If time_step is not the same for all the elements in the - input. + inputs. ValueError: If batch_size is not the same for all the elements in the - input. + inputs. """ state = initial_state assert isinstance(parallel_iterations, int), "parallel_iterations must be int"