diff options
author | 2018-01-25 14:42:03 -0800 | |
---|---|---|
committer | 2018-01-25 14:49:24 -0800 | |
commit | b998b7b456066530dd27ef532dae195d27505266 (patch) | |
tree | 86a8bc1c7c689c2ce63e67271ceb48aa9412d8d3 /tensorflow/contrib/lite/toco/model_cmdline_flags.cc | |
parent | 73b4b1502924acd461013d4ecf9825aedd3a3968 (diff) |
Drop the manually_create field from RnnState.
Initially, I thought that the shape of RNN state arrays could always be
determined by shape propagation. Then I came across some graphs where this
wasn't so easy to infer, so I introduced manually_create thinking of it
as a hack. Today I took another look at dropping that hack, and had a
"D'oh" moment when I realized that the cyclic nature of RNN graphs makes
it impossible to infer the shapes of all arrays by usual propagation.
For example, in a LSTM cell, the input array is concatenated with
a state array, so if we don't already know the shape of that state array,
shape propagation stops there.
Thus, this change removes manually_create by making toco always behave as
if manually_create=true, i.e. early-creating all RNN state arrays with
the shape explicitly specified by the user. The next TODO item here
(see model_flags.proto) is to introduce a generic 'shape' field, so far
the current 'size' field only allows specifying 1-D shapes.
PiperOrigin-RevId: 183294102
Diffstat (limited to 'tensorflow/contrib/lite/toco/model_cmdline_flags.cc')
-rw-r--r-- | tensorflow/contrib/lite/toco/model_cmdline_flags.cc | 3 |
1 files changed, 0 insertions, 3 deletions
diff --git a/tensorflow/contrib/lite/toco/model_cmdline_flags.cc b/tensorflow/contrib/lite/toco/model_cmdline_flags.cc index 790b3443ce..36520d9c55 100644 --- a/tensorflow/contrib/lite/toco/model_cmdline_flags.cc +++ b/tensorflow/contrib/lite/toco/model_cmdline_flags.cc @@ -327,9 +327,6 @@ void ReadModelFlagsFromCommandLineFlags( CHECK(absl::SimpleAtoi(value, &size)); CHECK_GT(size, 0); rnn_state_proto->set_size(size); - } else if (key == "manually_create") { - CHECK_EQ(absl::AsciiStrToLower(value), "true"); - rnn_state_proto->set_manually_create(true); } else { LOG(FATAL) << "Unknown key '" << key << "' in --rnn_states"; } |