提交 5ea0dad4 authored 作者: Frederic's avatar Frederic

pep8 and add a test that sparse.type stuff is always imported.

上级 4d1535d0
......@@ -122,8 +122,9 @@ class Binomial(gof.op.Op):
n = tensor.as_tensor_variable(n)
p = tensor.as_tensor_variable(p)
shape = tensor.as_tensor_variable(shape)
return gof.Apply(self, [n, p, shape], [SparseType(dtype=self.dtype,
format=self.format).make_variable()])
return gof.Apply(self, [n, p, shape],
[SparseType(dtype=self.dtype,
format=self.format).make_variable()])
def perform(self, node, (n, p, shape, ), (out, )):
binomial = numpy.random.binomial(n, p, size=shape)
......
def test_sparse_type():
import theano.sparse
# They need to be available even if scipy is not available.
assert hasattr(theano.sparse, "SparseType")
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论