提交 00e8b8f5 authored 作者: David Warde-Farley's avatar David Warde-Farley

PEP8: More E301, E302.

上级 1844ad38
...@@ -460,6 +460,7 @@ class CSMProperties(gof.Op): ...@@ -460,6 +460,7 @@ class CSMProperties(gof.Op):
# don't make this a function or it breaks some optimizations below # don't make this a function or it breaks some optimizations below
csm_properties = CSMProperties() csm_properties = CSMProperties()
def csm_data(csm): return csm_properties(csm)[0] def csm_data(csm): return csm_properties(csm)[0]
...@@ -634,6 +635,7 @@ class DenseFromSparse(gof.op.Op): ...@@ -634,6 +635,7 @@ class DenseFromSparse(gof.op.Op):
"""WRITEME""" """WRITEME"""
def __eq__(self, other): def __eq__(self, other):
return (type(self) == type(other)) return (type(self) == type(other))
def __hash__(self): def __hash__(self):
return hash(type(self)) return hash(type(self))
...@@ -644,6 +646,7 @@ class DenseFromSparse(gof.op.Op): ...@@ -644,6 +646,7 @@ class DenseFromSparse(gof.op.Op):
[tensor.TensorType(dtype=x.type.dtype, [tensor.TensorType(dtype=x.type.dtype,
broadcastable=(False, False) broadcastable=(False, False)
).make_variable()]) ).make_variable()])
def perform(self, node, (x, ), (out, )): def perform(self, node, (x, ), (out, )):
if _is_dense(x): if _is_dense(x):
print >> sys.stderr, "WARNING: You just called DenseFromSparse on a dense matrix." print >> sys.stderr, "WARNING: You just called DenseFromSparse on a dense matrix."
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论