提交 ac86ad3f authored 作者: ChienliMa's avatar ChienliMa

coding style fix

上级 bbf84ee2
......@@ -1558,7 +1558,7 @@ class CLinker(link.Linker):
if (i + len(in_storage)) not in dupidx]
in_storage = [x for i, x in enumerate(in_storage) if i not in dupidx]
if storage_map is None:
orphd = [[orphan.data] for orphan in self.orphans]
orphd = [[orphan.data] for orphan in self.orphans]
else:
orphd = [storage_map[orphan] for orphan in self.orphans]
......@@ -1719,7 +1719,7 @@ class OpWiseCLinker(link.LocalLinker):
return self
def make_all(self, profiler=None, input_storage=None, output_storage=None,
storage_map=None):
storage_map=None):
# The lock will be acquired when we compile the first
# C code. We will keep the lock untill all the function
......
......@@ -820,7 +820,7 @@ class FunctionGraph(utils.object2):
"""Clone the graph and get a memo( a dict )that map old node to new node
----------------------------
Parameters:
check_integrity - { bool } Whether to check integrity.
check_integrity - { bool } Whether to check integrity.
Default is True.
attach_feature - { bool } Whether to attach feature of origin graph to
cloned graph. Default is True.
......@@ -830,7 +830,7 @@ class FunctionGraph(utils.object2):
equiv - { dict } A dict that map old node to new node.
"""
equiv = graph.clone_get_equiv(self.inputs, self.outputs)
if check_integrity:
self.check_integrity()
e = FunctionGraph([equiv[i] for i in self.inputs],
......
......@@ -551,10 +551,10 @@ def map_storage(fgraph, order, input_storage, output_storage, storage_map=None):
# add input storage into storage_map
for r, storage in zip(fgraph.inputs, input_storage):
if r in storage_map:
assert storage_map[r] is storage, (
"Given input_storage conflicts with storage in given"
"storage_map. Given input_storage: ", storage,
"Storage in storage_map: ", storage_map[r])
assert storage_map[r] is storage,
("Given input_storage conflicts with storage in given"
"storage_map. Given input_storage: ", storage,
"Storage in storage_map: ", storage_map[r])
else:
storage_map[r] = storage
# for orphan in fgraph.orphans:
......@@ -567,8 +567,8 @@ def map_storage(fgraph, order, input_storage, output_storage, storage_map=None):
assert len(fgraph.outputs) == len(output_storage)
for r, storage in zip(fgraph.outputs, output_storage):
if r in storage_map:
assert storage_map[r] is storage, (
"Given output_storage conflicts with storage in given"
assert storage_map[r] is storage,
("Given output_storage conflicts with storage in given"
"storage_map. Given output_storage: ", storage,
"Storage in storage_map: ", storage_map[r])
else:
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论