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

coding style fix

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