Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

use enumerate instead of iterating with range and len #26701

Merged
merged 1 commit into from Mar 23, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 2 additions & 2 deletions tensorflow/lite/python/op_hint.py
Expand Up @@ -795,7 +795,7 @@ def _find_children_hints_in_while_loop(function_def, nodes_mapping):

# Make nodes inside function def inputs point to the real nodes.
for node in function_def.node_def:
for i in range(len(node.input)):
for i, _ in enumerate(node.input):
if node.input[i] in nodes_mapping:
node.input[i] = nodes_mapping[node.input[i]]
new_nodes.append(_copy.deepcopy(node))
Expand Down Expand Up @@ -855,7 +855,7 @@ def _find_children_hints(call, graph_def):
function_inputs = function_def.signature.input_arg
assert len(inputs_outside_loop) == len(function_inputs)
nodes_mapping = {}
for i in range(len(function_inputs)):
for i, _ in enumerate(function_inputs):
nodes_mapping[function_inputs[i].name] = inputs_outside_loop[i]
# TODO(b/123050804): Consider use grappler.
(children_hints_in_loop,
Expand Down