Commit 1278d68f by lixiaoquan Committed by Tianqi Chen

Fix an OrderDict initilization bug. (#2862)

The dict which is used to initilize OrderDict is not ordered, so
  metadata may not be at the end.
parent 89acfeb2
......@@ -365,14 +365,14 @@ class GraphRuntimeCodegen(ExprFunctor):
metadata['signatures']['default']['outputs'][node_name]['shape'] = shapes[node_id[0]]
# Keep 'metadata' always at end
json_dict = OrderedDict({
"nodes": nodes,
"arg_nodes": arg_nodes,
"heads": heads,
"attrs": attrs,
"node_row_ptr": node_row_ptr,
"metadata": metadata
})
json_dict = OrderedDict([
("nodes", nodes),
("arg_nodes", arg_nodes),
("heads", heads),
("attrs", attrs),
("node_row_ptr", node_row_ptr),
("metadata", metadata),
])
return json.dumps(json_dict, indent=2)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment