提交 040d0f80 authored 作者: Razvan Pascanu's avatar Razvan Pascanu

fix assertion and corrected formating

上级 5e3c2b9d
...@@ -828,8 +828,8 @@ def hessian(cost, wrt, consider_constant=None, warn_type=False, ...@@ -828,8 +828,8 @@ def hessian(cost, wrt, consider_constant=None, warn_type=False,
for input in wrt: for input in wrt:
assert isinstance(input, TensorVariable), \ assert isinstance(input, TensorVariable), \
"tensor.hessian expects a (list of) Tensor Variable as `wrt`" "tensor.hessian expects a (list of) Tensor Variable as `wrt`"
assert input.ndim == 0, \ assert input.ndim == 1, \
"tensor.hessian expects a (list of) 1 dimensional variable"\ "tensor.hessian expects a (list of) 1 dimensional variable "\
"as `wrt`" "as `wrt`"
expr = grad(cost, input) expr = grad(cost, input)
hess, updates = theano.scan(lambda i, y, x: grad( hess, updates = theano.scan(lambda i, y, x: grad(
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论