Skip to content

Commit

Permalink
[Torch] fix unordered dictionary problem for python version under 3.6 (
Browse files Browse the repository at this point in the history
…#4982)

* fix unordered dictionary problem for python version 3.5

* modify style
  • Loading branch information
pyjhzwh authored Mar 4, 2020
1 parent 98b1759 commit 5a0f39b
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions python/tvm/relay/frontend/pytorch.py
Original file line number Diff line number Diff line change
Expand Up @@ -918,7 +918,7 @@ def _get_constant(node):

def _get_operator_nodes(nodes):
""" Returns torch IR nodes that need conversion to Relay """
ops = {}
ops = []
# Traverse nodes and add to graph
for node in nodes:
if node.outputsSize() > 1:
Expand All @@ -927,7 +927,7 @@ def _get_operator_nodes(nodes):
node_name = _get_output_name(node)

if node.kind() != "prim::GetAttr":
ops[node_name] = node
ops.append((node_name, node))

return ops

Expand Down Expand Up @@ -1015,7 +1015,7 @@ def parse_params(graph, state_dict):

def parse_operators(operators, outputs, output_index_map, ret_name):
""" Convert each Torch IR operators to Relay equivalent """
for node_name, op_node in operators.items():
for node_name, op_node in operators:
operator = op_node.kind()
inputs = _get_op_inputs(op_node, outputs, output_index_map)

Expand Down

0 comments on commit 5a0f39b

Please sign in to comment.