[tensor tracer]: fixing the non-deterministic node naming in tensor tracer.

PiperOrigin-RevId: 241597947
This commit is contained in:
A. Unique TensorFlower 2019-04-02 13:58:34 -07:00 committed by TensorFlower Gardener
parent 2708eb881c
commit 6d6e671b67

View File

@ -1552,8 +1552,10 @@ class TensorTracer(object):
current_control_flow_context = graph._get_control_flow_context()
# pylint: enable=protected-access
sorted_exec_op_list = list(exec_op_set)
sorted_exec_op_list.sort(key=lambda op: op.name)
# Trace ops only if they are in the execution path.
for op in exec_op_set:
for op in sorted_exec_op_list:
for i in range(len(op.outputs)):
out_tensor = op.outputs[i]
tensor_name = out_tensor.name