提交 4f54466f authored 作者: Frederic's avatar Frederic

pep8, code clean up

上级 5d1a9db8
...@@ -1445,7 +1445,6 @@ def local_fill_sink(node): ...@@ -1445,7 +1445,6 @@ def local_fill_sink(node):
# The newly created node c doesn't has 'clients', # The newly created node c doesn't has 'clients',
# so this iteration is took place with node.outputs[0] # so this iteration is took place with node.outputs[0]
replacements = {node.outputs[0]: c} replacements = {node.outputs[0]: c}
all_clients_replaced = True
for client, cl_idx in node.outputs[0].clients: for client, cl_idx in node.outputs[0].clients:
if (hasattr(client, 'op') and if (hasattr(client, 'op') and
isinstance(client.op, T.Elemwise) and isinstance(client.op, T.Elemwise) and
...@@ -1458,14 +1457,8 @@ def local_fill_sink(node): ...@@ -1458,14 +1457,8 @@ def local_fill_sink(node):
new_client.owner.outputs[0].clients = client.outputs[0].clients new_client.owner.outputs[0].clients = client.outputs[0].clients
r = local_fill_sink.transform(new_client.owner) r = local_fill_sink.transform(new_client.owner)
if not r: if not r:
all_clients_replaced = False
continue continue
replacements.update(r) replacements.update(r)
else:
all_clients_replaced = False
# Why this was added? I don't see why and I don't see it causing test failure.
# if all_clients_replaced:
# replacements.pop(node.outputs[0], None)
return replacements return replacements
register_canonicalize(local_fill_sink) register_canonicalize(local_fill_sink)
...@@ -5802,7 +5795,7 @@ def local_grad_log_erfc_neg(node): ...@@ -5802,7 +5795,7 @@ def local_grad_log_erfc_neg(node):
exp = inp exp = inp
break break
if len(mul.owner.inputs) == 2: if len(mul.owner.inputs) == 2:
y = [mul.owner.inputs[1-idx]] y = [mul.owner.inputs[1 - idx]]
else: else:
y = mul.owner.inputs[:] y = mul.owner.inputs[:]
del y[idx] del y[idx]
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论