提交 619b7be6 authored 作者: Razvan Pascanu's avatar Razvan Pascanu

fix to the test to account for the error raised by grad

上级 39108661
......@@ -2023,9 +2023,13 @@ class T_max_and_argmax(unittest.TestCase):
def test_arg_grad(self):
x = matrix()
cost = argmax(x, axis=0).sum()
gx = grad(cost, x)
cost = argmin(x, axis=0).sum()
gx = grad(cost, x)
try:
gx = grad(cost, x)
except ValueError:
# It is the error saying there is no differentiable path to the
# input
pass
def test_grad(self):
data = rand(2, 3)
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论