提交 08bd312a authored 作者: serdyuk's avatar serdyuk

Removed comparisons with None

上级 5c9e0b31
......@@ -1069,7 +1069,7 @@ class FunctionMaker(object):
if hasattr(remove, 'fgraph'):
del remove.fgraph
if hasattr(remove, 'owner'):
if remove.owner == None:
if remove.owner is None:
pass
else:
if hasattr(remove.owner, 'fgraph'):
......
......@@ -28,7 +28,7 @@ def checkfor(testcase, fn, E):
# we got the exception we wanted
return
else:
# we did not get the exception we wanted
# we did not getishe exception we wanted
raise
# fn worked, but it shouldn't have
testcase.fail()
......
......@@ -1627,7 +1627,7 @@ class SpSum(gof.op.Op):
return gof.Apply(self, [x], [z])
def perform(self, node, (x,), (z,)):
if self.axis == None:
if self.axis is None:
z[0] = numpy.asarray(x.sum())
else:
z[0] = numpy.asarray(x.sum(self.axis)).ravel()
......
......@@ -670,7 +670,7 @@ def norm(x,ord):
if ndim == 0:
raise ValueError("'axis' entry is out of bounds.")
elif ndim == 1:
if ord == None:
if ord is None:
return tensor.sum(x**2)**0.5
elif ord == 'inf':
return tensor.max(abs(x))
......@@ -685,7 +685,7 @@ def norm(x,ord):
raise ValueError("Invalid norm order for vectors.")
return z
elif ndim == 2:
if ord == None or ord == 'fro':
if ord is None or ord == 'fro':
return tensor.sum(abs(x**2))**(0.5)
elif ord == 'inf':
return tensor.max(tensor.sum(abs(x), 1))
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论