Fix ophinted model with pure identity nodes as outputs.

PiperOrigin-RevId: 280331023
Change-Id: Ica0b741483500ff8b900c766e4b3dc9f4bae9bf5
This commit is contained in:
Renjie Liu 2019-11-13 19:04:56 -08:00 committed by TensorFlower Gardener
parent 213305f75c
commit a73e0bb98a
3 changed files with 2 additions and 1 deletions

View File

@ -226,7 +226,6 @@ def _convert_op_hints_if_present(sess, graph_def, output_tensors,
graph_def = tf_graph_util.convert_variables_to_constants(
sess, graph_def, output_arrays + hinted_outputs_nodes)
graph_def = convert_op_hints_to_stubs(graph_def=graph_def)
graph_def = tf_graph_util.remove_training_nodes(graph_def)
return graph_def

View File

@ -64,6 +64,7 @@ def make_unidirectional_sequence_lstm_tests(options):
outs, _ = tf.nn.static_rnn(lstm_cell, input_values, dtype=tf.float32)
real_output = tf.zeros([1], dtype=tf.float32) + outs[-1]
real_output = tf.identity(real_output)
return input_values, [real_output]
def build_inputs(parameters, sess, inputs, outputs):

View File

@ -61,6 +61,7 @@ def make_unidirectional_sequence_rnn_tests(options):
outs, _ = tf.nn.static_rnn(rnn_cell, input_values, dtype=tf.float32)
real_output = tf.zeros([1], dtype=tf.float32) + outs[-1]
real_output = tf.identity(real_output)
return input_values, [real_output]
def build_inputs(parameters, sess, inputs, outputs):