提交 b9d87caa authored 作者: Razvan Pascanu's avatar Razvan Pascanu

no need for the if/else

上级 5b53939c
...@@ -107,12 +107,9 @@ def remove_constants_and_unused_inputs_scan(node): ...@@ -107,12 +107,9 @@ def remove_constants_and_unused_inputs_scan(node):
identical_seqs = [x for x in nw_outer identical_seqs = [x for x in nw_outer
if scan_utils.equal_computations( if scan_utils.equal_computations(
[x], [node.inputs[idx + 1]])] [x], [node.inputs[idx + 1]])]
if identical_seqs and False: if identical_seqs:
index = node.inputs.index(identical_seqs[0]) - 1 index = node.inputs.index(identical_seqs[0]) - 1
if op_ins[index] not in givens.keys():
givens[op_ins[idx]] = op_ins[index] givens[op_ins[idx]] = op_ins[index]
else:
givens[op_ins[idx]] = givens[op_ins[index]]
else: else:
nw_inner += [op_ins[idx]] nw_inner += [op_ins[idx]]
nw_outer += [node.inputs[idx + 1]] nw_outer += [node.inputs[idx + 1]]
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论