提交 3940914a authored 作者: Frederic's avatar Frederic

better check

上级 54bf7b7e
...@@ -5224,7 +5224,7 @@ class Choose(Op): ...@@ -5224,7 +5224,7 @@ class Choose(Op):
# import at the top as it would cause circular import. # import at the top as it would cause circular import.
import theano.typed_list import theano.typed_list
a = as_tensor_variable(a) a = as_tensor_variable(a)
if "int" not in a.dtype: if a.dtype not in theano.tensor.discrete_dtypes:
raise TypeError( raise TypeError(
'choose first argument must have an [u]int* dtype. Got %s.' 'choose first argument must have an [u]int* dtype. Got %s.'
% a.dtype) % a.dtype)
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论