提交 99773d3b authored 作者: Ian Goodfellow's avatar Ian Goodfellow

fixed bad attempt at a type check

上级 51290164
...@@ -468,7 +468,7 @@ def grad(cost, wrt, consider_constant=None, ...@@ -468,7 +468,7 @@ def grad(cost, wrt, consider_constant=None,
'Ambiguous whether %s should be made into tensor' 'Ambiguous whether %s should be made into tensor'
' or sparse theano variable' % str(type(g_var))) ' or sparse theano variable' % str(type(g_var)))
if g_var.type not in [NullType, DisconnectedType] and 'float' \ if not isinstance(g_var.type, (NullType, DisconnectedType)) and 'float' \
not in str(g_var.type.dtype): not in str(g_var.type.dtype):
raise TypeError("Gradients must always be NullType, " raise TypeError("Gradients must always be NullType, "
"DisconnectedType, or continuous, but grad was " "DisconnectedType, or continuous, but grad was "
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论