提交 09be448a authored 作者: ChienliMa's avatar ChienliMa

Modify to fit python3

上级 74cdb5db
...@@ -624,7 +624,7 @@ class Function(object): ...@@ -624,7 +624,7 @@ class Function(object):
# Check if given ShareVariables exist # Check if given ShareVariables exist
for sv in iterkeys(swap): for sv in iterkeys(swap):
if not exist_svs.has_key(sv): if not sv in exist_svs:
raise ValueError("SharedVariable: %s not found" % raise ValueError("SharedVariable: %s not found" %
(sv.name)) (sv.name))
...@@ -635,7 +635,7 @@ class Function(object): ...@@ -635,7 +635,7 @@ class Function(object):
# Otherwise we don't touch them. # Otherwise we don't touch them.
var = maker.inputs[index].variable var = maker.inputs[index].variable
if swap.has_key(var): if var in swap:
swap_sv = swap[var] swap_sv = swap[var]
checkSV(i.variable, swap_sv) checkSV(i.variable, swap_sv)
...@@ -708,7 +708,7 @@ class Function(object): ...@@ -708,7 +708,7 @@ class Function(object):
f_cpy.input_storage): f_cpy.input_storage):
# Share immutable ShareVariable and constant input's storage # Share immutable ShareVariable and constant input's storage
swapped = swap is not None and swap.has_key(in_ori.variable) swapped = swap is not None and in_ori.variable in swap
# Using the original storage if SharedVariable will not be updated # Using the original storage if SharedVariable will not be updated
# and is not swapped # and is not swapped
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论