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

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

上级 45a796b4
...@@ -419,10 +419,14 @@ def makeSharedTester(shared_constructor_, ...@@ -419,10 +419,14 @@ 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.
shape_grad = tensor.grad(x1_specify_shape.sum(), x1_shared) if isinstance(x1_specify_shape.type, theano.sparse.SparseType):
shape_constant_fct_grad = theano.function([], shape_grad) #SparseVariable don't support sum for now.
theano.printing.debugprint(shape_constant_fct_grad) assert not hasattr(x1_specify_shape, 'sum')
shape_constant_fct_grad() else:
shape_grad = tensor.grad(x1_specify_shape.sum(), x1_shared)
shape_constant_fct_grad = theano.function([], shape_grad)
theano.printing.debugprint(shape_constant_fct_grad)
shape_constant_fct_grad()
#Test that we can replace with values of the different shape #Test that we can replace with values of the different shape
# but that will raise an error in some case, but not all # but that will raise an error in some case, but not all
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论