提交 75a8e24b authored 作者: Razvan Pascanu's avatar Razvan Pascanu

bugs in spelling isinstance

上级 745ece55
...@@ -740,12 +740,12 @@ def jacobian(expression, wrt, consider_constant=None, warn_type=False, ...@@ -740,12 +740,12 @@ def jacobian(expression, wrt, consider_constant=None, warn_type=False,
as `wrt`: a list/tuple or TensorVariable in all cases. as `wrt`: a list/tuple or TensorVariable in all cases.
""" """
# Check inputs have the right format # Check inputs have the right format
assert isisntance(expression, TensorVariable), \ assert isinstance(expression, TensorVariable), \
"tensor.jacobian expects a Tensor Variable as `expression`" "tensor.jacobian expects a Tensor Variable as `expression`"
assert expression.ndim == 1, \ assert expression.ndim == 1, \
"tensor.jacobian expects a 1 dimensional variable as `expression`" "tensor.jacobian expects a 1 dimensional variable as `expression`"
if isintance(wrt, (list, tuple)): if isinstance(wrt, (list, tuple)):
use_list = True use_list = True
wrt = list(wrt) wrt = list(wrt)
else: else:
...@@ -800,12 +800,12 @@ def hessian(cost, wrt, consider_constant=None, warn_type=False, ...@@ -800,12 +800,12 @@ def hessian(cost, wrt, consider_constant=None, warn_type=False,
as `wrt`: a list/tuple or TensorVariable in all cases. as `wrt`: a list/tuple or TensorVariable in all cases.
""" """
# Check inputs have the right format # Check inputs have the right format
assert isisntance(cost, TensorVariable), \ assert isinstance(cost, TensorVariable), \
"tensor.hessian expects a Tensor Variable as `cost`" "tensor.hessian expects a Tensor Variable as `cost`"
assert cost.ndim == 0, \ assert cost.ndim == 0, \
"tensor.hessian expects a 0 dimensional variable as `cost`" "tensor.hessian expects a 0 dimensional variable as `cost`"
if isintance(wrt, (list, tuple)): if isinstance(wrt, (list, tuple)):
use_list = True use_list = True
wrt = list(wrt) wrt = list(wrt)
else: else:
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论