Add support for RNN state array of type tf.identity.
authorA. Unique TensorFlower <gardener@tensorflow.org>
Thu, 12 Apr 2018 23:26:13 +0000 (16:26 -0700)
committerTensorFlower Gardener <gardener@tensorflow.org>
Thu, 12 Apr 2018 23:28:23 +0000 (16:28 -0700)
PiperOrigin-RevId: 192689747

tensorflow/contrib/lite/toco/graph_transformations/remove_unused_op.cc

index aa2c293..8e6aaf5 100644 (file)
@@ -47,7 +47,8 @@ bool RemoveUnusedOp::Run(Model* model, std::size_t op_index) {
     bool found_output_as_rnn_state_array = false;
     for (const auto& rnn_state : model->flags.rnn_states()) {
       if (output == rnn_state.state_array()) {
-        CHECK(op->type == OperatorType::kFill);
+        CHECK(op->type == OperatorType::kFill ||
+              op->type == OperatorType::kTensorFlowIdentity);
         found_output_as_rnn_state_array = true;
         break;
       }