提交 ac369fd9 authored 作者: Nicolas Bouchard's avatar Nicolas Bouchard

Correction of the test for local_csm_grad_c optimization

上级 5410b7ca
......@@ -22,6 +22,7 @@ local_usmm = gof.opt.PatternSub(
(usmm, (theano.tensor.neg, 'alpha'), 'x', 'y', 'z'))
register_specialize(local_usmm, name="local_usmm")
# This is tested in tests/test_opt.py:test_local_csm_grad_c
@gof.local_optimizer([csm_grad(None)])
def local_csm_grad_c(node):
......
......@@ -45,7 +45,7 @@ def test_local_csm_grad_c():
cost = tensor.sum(DenseFromSparse()(CS(data, indices, indptr, shape)))
f = theano.function(
[data, indices, indptr, shape],
cost,
tensor.grad(cost, data),
mode=mode)
assert not any(isinstance(node.op, CSMGrad) for node
in f.maker.env.toposort())
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论