Fix ophinted model with pure identity nodes as outputs.
PiperOrigin-RevId: 280331023 Change-Id: Ica0b741483500ff8b900c766e4b3dc9f4bae9bf5
This commit is contained in:
parent
213305f75c
commit
a73e0bb98a
@ -226,7 +226,6 @@ def _convert_op_hints_if_present(sess, graph_def, output_tensors,
|
|||||||
graph_def = tf_graph_util.convert_variables_to_constants(
|
graph_def = tf_graph_util.convert_variables_to_constants(
|
||||||
sess, graph_def, output_arrays + hinted_outputs_nodes)
|
sess, graph_def, output_arrays + hinted_outputs_nodes)
|
||||||
graph_def = convert_op_hints_to_stubs(graph_def=graph_def)
|
graph_def = convert_op_hints_to_stubs(graph_def=graph_def)
|
||||||
graph_def = tf_graph_util.remove_training_nodes(graph_def)
|
|
||||||
return graph_def
|
return graph_def
|
||||||
|
|
||||||
|
|
||||||
|
@ -64,6 +64,7 @@ def make_unidirectional_sequence_lstm_tests(options):
|
|||||||
outs, _ = tf.nn.static_rnn(lstm_cell, input_values, dtype=tf.float32)
|
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.zeros([1], dtype=tf.float32) + outs[-1]
|
||||||
|
real_output = tf.identity(real_output)
|
||||||
return input_values, [real_output]
|
return input_values, [real_output]
|
||||||
|
|
||||||
def build_inputs(parameters, sess, inputs, outputs):
|
def build_inputs(parameters, sess, inputs, outputs):
|
||||||
|
@ -61,6 +61,7 @@ def make_unidirectional_sequence_rnn_tests(options):
|
|||||||
outs, _ = tf.nn.static_rnn(rnn_cell, input_values, dtype=tf.float32)
|
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.zeros([1], dtype=tf.float32) + outs[-1]
|
||||||
|
real_output = tf.identity(real_output)
|
||||||
return input_values, [real_output]
|
return input_values, [real_output]
|
||||||
|
|
||||||
def build_inputs(parameters, sess, inputs, outputs):
|
def build_inputs(parameters, sess, inputs, outputs):
|
||||||
|
Loading…
Reference in New Issue
Block a user