提交 1013b458 authored 作者: Frederic Bastien's avatar Frederic Bastien

Fix pickling and zip in Python 3.

上级 fcbb56ed
......@@ -330,7 +330,7 @@ class FunctionGraph(utils.object2):
if not used_or_output:
if not hasattr(apply_node.tag, 'removed_by'):
apply_node.tag.removed_by = []
apply_node.tag.removed_by.append(reason)
apply_node.tag.removed_by.append(str(reason))
self.apply_nodes.remove(apply_node)
self.variables.difference_update(apply_node.outputs)
self.execute_callbacks('on_prune', apply_node, reason)
......@@ -421,7 +421,7 @@ class FunctionGraph(utils.object2):
self.apply_nodes.add(node)
if not hasattr(node.tag, 'imported_by'):
node.tag.imported_by = []
node.tag.imported_by.append(reason)
node.tag.imported_by.append(str(reason))
for output in node.outputs:
self.__setup_r__(output)
self.variables.add(output)
......
......@@ -202,7 +202,7 @@ def remove_constants_and_unused_inputs_scan(node):
# DEBUG CHECK
nwScan = scan_op.Scan(nw_inner, op_outs, nw_info)
nw_outs = nwScan(*nw_outer, **dict(return_list=True))
return dict([("remove", [node])] + zip(node.outputs, nw_outs))
return dict([("remove", [node])] + list(zip(node.outputs, nw_outs)))
else:
return False
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论