提交 d4436e8e authored 作者: Olivier Delalleau's avatar Olivier Delalleau

Improved test

上级 7d354827
...@@ -1070,6 +1070,12 @@ def test_not_implemented_elemwise_grad(): ...@@ -1070,6 +1070,12 @@ def test_not_implemented_elemwise_grad():
x = tensor.scalar() x = tensor.scalar()
# The call to `grad` used to crash. # The call to `grad` used to crash.
tensor.grad(test_op(2, x), x) tensor.grad(test_op(2, x), x)
# Verify that trying to use the not implemented gradient fails.
try:
tensor.grad(test_op(x, 2), x)
assert False
except theano.gradient.NullTypeGradError:
pass
if __name__ == '__main__': if __name__ == '__main__':
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论