提交 fd6111df authored 作者: James Bergstra's avatar James Bergstra

replaced assert with TypeError in pfunc

上级 717ebfce
......@@ -137,7 +137,8 @@ def pfunc(params, outputs=None, mode=None, updates=[], givens=[]):
# - replace some update expressions (but update keys remain)
new_updates = {}
for (store_into, update_val) in iter_over_pairs(updates):
assert isinstance(store_into, SharedVariable)
if not isinstance(store_into, SharedVariable):
raise TypeError('update target must be a SharedVariable', store_into)
update_val = v_clone(store_into.filter_update(update_val))
if update_val.type != store_into.type:
raise TypeError('an update must have the same type as the original shared variable',
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论