提交 038e3a3f authored 作者: sentient07's avatar sentient07

Removed a hack that has been fixed in a different PR

上级 9543056a
...@@ -333,10 +333,6 @@ class SeqOptimizer(Optimizer, list): ...@@ -333,10 +333,6 @@ class SeqOptimizer(Optimizer, list):
print(blanc, ' %.6fs - %s' % (t, opt), file=stream) print(blanc, ' %.6fs - %s' % (t, opt), file=stream)
if sub_profs[i]: if sub_profs[i]:
if isinstance(opts[i], MergeOptimizer):
if len(sub_profs[i]) == 8:
sub_profs[i] = sub_profs[i][:-1]
assert len(sub_profs[i]) == 7
opts[i].print_profile(stream, sub_profs[i], opts[i].print_profile(stream, sub_profs[i],
level=level + 1) level=level + 1)
print(file=stream) print(file=stream)
...@@ -1311,12 +1307,12 @@ class LocalOptGroup(LocalOptimizer): ...@@ -1311,12 +1307,12 @@ class LocalOptGroup(LocalOptimizer):
if not repl: if not repl:
continue continue
else: else:
assert len(repl) == 1
if self.profile: if self.profile:
self.node_created[opt] += len(graph.ops(fgraph.variables, repl)) self.node_created[opt] += len(graph.ops(fgraph.variables, repl))
self.applied_true[opt] += 1 self.applied_true[opt] += 1
if not multiple_opts or not repl[0].owner: if not multiple_opts or not repl[0].owner:
return repl return repl
assert len(repl) == 1
# Ensuring not the input of graph # Ensuring not the input of graph
assert repl[0].owner assert repl[0].owner
new_node = repl[0].owner new_node = repl[0].owner
...@@ -2601,10 +2597,6 @@ class EquilibriumOptimizer(NavigatorOptimizer): ...@@ -2601,10 +2597,6 @@ class EquilibriumOptimizer(NavigatorOptimizer):
print(blanc, "merge not implemented for ", o) print(blanc, "merge not implemented for ", o)
for o, prof in zip(opt.cleanup_optimizers, cleanup_sub_profs[i]): for o, prof in zip(opt.cleanup_optimizers, cleanup_sub_profs[i]):
try: try:
if isinstance(o, MergeOptimizer):
if len(prof) == 8:
prof = prof[:-1]
assert len(prof) == 7
o.print_profile(stream, prof, level + 2) o.print_profile(stream, prof, level + 2)
except NotImplementedError: except NotImplementedError:
print(blanc, "merge not implemented for ", o) print(blanc, "merge not implemented for ", o)
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论