提交 4db024e2 authored 作者: Frédéric Bastien's avatar Frédéric Bastien 提交者: GitHub

Merge pull request #5313 from nouiz/python2_3

Python2 3
...@@ -161,7 +161,7 @@ class MetaObject(type): ...@@ -161,7 +161,7 @@ class MetaObject(type):
if props is not None: if props is not None:
if not isinstance(props, tuple): if not isinstance(props, tuple):
raise TypeError("__props__ has to be a tuple") raise TypeError("__props__ has to be a tuple")
if not all(isinstance(p, str) for p in props): if not all(isinstance(p, string_types) for p in props):
raise TypeError("elements of __props__ have to be strings") raise TypeError("elements of __props__ have to be strings")
def _props(self): def _props(self):
......
...@@ -240,7 +240,7 @@ def Rop(f, wrt, eval_points): ...@@ -240,7 +240,7 @@ def Rop(f, wrt, eval_points):
elif inp.owner is None: elif inp.owner is None:
try: try:
local_eval_points.append(inp.zeros_like()) local_eval_points.append(inp.zeros_like())
except: except Exception:
# None should be used for non-differentiable # None should be used for non-differentiable
# arguments, like for example random states # arguments, like for example random states
local_eval_points.append(None) local_eval_points.append(None)
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论