提交 e731582c authored 作者: Ian Goodfellow's avatar Ian Goodfellow

added some type checking / an error message to scan so it will fail a little…

added some type checking / an error message to scan so it will fail a little more gracefully if passed bad arguments
上级 8a01deb0
......@@ -415,6 +415,10 @@ def scan( fn
# each frame by the corresponding slice
nw_slice = seq['input'][0].type()
actual_slice = seq['input'][k-mintap]
if not hasattr(seq['input'],'name'):
raise TypeError('Expected object with a "name" field, got '+str(seq)+"['input'] = "+str(seq['input']))
# Add names to slices for debugging and pretty printing ..
# that is if the input already has a name
if seq['input'].name:
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论