提交 930d093a authored 作者: Frederic Bastien's avatar Frederic Bastien

fix a test the requested not implemented feature on the sparse type.

上级 45a796b4
...@@ -419,6 +419,10 @@ def makeSharedTester(shared_constructor_, ...@@ -419,6 +419,10 @@ def makeSharedTester(shared_constructor_,
assert len(topo_cst)==0 assert len(topo_cst)==0
# Test that we can take the grad. # Test that we can take the grad.
if isinstance(x1_specify_shape.type, theano.sparse.SparseType):
#SparseVariable don't support sum for now.
assert not hasattr(x1_specify_shape, 'sum')
else:
shape_grad = tensor.grad(x1_specify_shape.sum(), x1_shared) shape_grad = tensor.grad(x1_specify_shape.sum(), x1_shared)
shape_constant_fct_grad = theano.function([], shape_grad) shape_constant_fct_grad = theano.function([], shape_grad)
theano.printing.debugprint(shape_constant_fct_grad) theano.printing.debugprint(shape_constant_fct_grad)
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论