提交 64aaf262 authored 作者: Frederic's avatar Frederic

Better error message.

上级 14b6cd35
...@@ -7214,6 +7214,10 @@ class AdvancedSubtensor1(Op): ...@@ -7214,6 +7214,10 @@ class AdvancedSubtensor1(Op):
assert len(inputs) == 2 assert len(inputs) == 2
if x.type.sparse_grad: if x.type.sparse_grad:
if x.type.ndim != 2:
raise TypeError(
"AdvancedSubtensor1: you can't take the sparse grad"
" from a tensor with ndim != 2. ndim is " + str(x.type.ndim))
if sparse_module_ref is None: if sparse_module_ref is None:
import theano.sparse as sparse_module_ref import theano.sparse as sparse_module_ref
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论