Don't annotate _tflite_function_uuid when there's no OpHints

PiperOrigin-RevId: 239517897
This commit is contained in:
Yu-Cheng Ling 2019-03-20 18:28:26 -07:00 committed by TensorFlower Gardener
parent 416047559c
commit 996aeecdaf

View File

@ -728,10 +728,10 @@ def _find_all_hints_in_nodes(nodes):
for node in nodes: for node in nodes:
attr = node.attr attr = node.attr
# This is an op hint if it has a FUNCTION_UUID_ATTR, otherwise skip # This is an op hint if it has a FUNCTION_UUID_ATTR, otherwise skip
uuid = attr[OpHint.FUNCTION_UUID_ATTR].s
if (OpHint.FUNCTION_UUID_ATTR not in attr if (OpHint.FUNCTION_UUID_ATTR not in attr
or not attr[OpHint.FUNCTION_UUID_ATTR].s): or not attr[OpHint.FUNCTION_UUID_ATTR].s):
continue continue
uuid = attr[OpHint.FUNCTION_UUID_ATTR].s
# Start building function # Start building function
call_def = func_calls[uuid] call_def = func_calls[uuid]