提交 dfb2e74c authored 作者: Tim Cooijmans's avatar Tim Cooijmans

map_variables: fix typo and use except...as syntax

上级 20d074d2
...@@ -417,7 +417,7 @@ def _map_variables_inner(replacer, inner_inputs, outer_inputs, inner_outputs): ...@@ -417,7 +417,7 @@ def _map_variables_inner(replacer, inner_inputs, outer_inputs, inner_outputs):
# `fg` can take ownership of # `fg` can take ownership of
for input_ in constants: for input_ in constants:
new_input = input_.clone() new_input = input_.clone()
new_input.name = "%s_copiedd" % new_input.name new_input.name = "%s_copied" % new_input.name
replacements.append((input_, new_input)) replacements.append((input_, new_input))
for outer_input in foreign_inputs: for outer_input in foreign_inputs:
......
...@@ -106,7 +106,7 @@ class TestMapVariables(object): ...@@ -106,7 +106,7 @@ class TestMapVariables(object):
outputs_info=[numpy.array(0.)]) outputs_info=[numpy.array(0.)])
try: try:
s2, = map_variables(self.replacer, [s]) s2, = map_variables(self.replacer, [s])
except NotImplementedError, e: except NotImplementedError as e:
e = sys.exc_info()[1] e = sys.exc_info()[1]
assert("introduces shared variable" in str(e)) assert("introduces shared variable" in str(e))
return return
...@@ -137,7 +137,7 @@ class TestMapVariables(object): ...@@ -137,7 +137,7 @@ class TestMapVariables(object):
outputs_info=[numpy.array(0.)]) outputs_info=[numpy.array(0.)])
try: try:
s2, = map_variables(self.replacer, [s]) s2, = map_variables(self.replacer, [s])
except NotImplementedError, e: except NotImplementedError as e:
e = sys.exc_info()[1] e = sys.exc_info()[1]
assert("introduces shared variable" in str(e)) assert("introduces shared variable" in str(e))
return return
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论