提交 4a2312bd authored 作者: James Bergstra's avatar James Bergstra

New exception messages in Scan

上级 e50625a9
...@@ -211,17 +211,18 @@ class Scan(theano.Op): ...@@ -211,17 +211,18 @@ class Scan(theano.Op):
raise ValueError('Scan should iterate over at least on one input') raise ValueError('Scan should iterate over at least on one input')
if n_outs <1: if n_outs <1:
raise ValueError('Scan should have at least one output') raise ValueError('Scan should have at least one output')
if (n_inplace > n_ins) or \ if (n_inplace > n_ins):
(n_inplace > n_outs): raise ValueError('Number of inplace outputs should be smaller than '
raise ValueError('Number of inline outs should be smaller then'\ 'the number of inputs.')
'the number of inputs or outputs')
if (n_inplace < 0): if (n_inplace < 0):
raise ValueError('Number of inplace outputs should be larger '\ raise ValueError('Number of inplace outputs should be larger '
'or equal to 0') 'or equal to 0')
if (n_inplace_ignore > n_inplace): if (n_inplace_ignore > n_inplace):
raise ValueError('Number of inputs to ignore should not be '\ raise ValueError('Number of inputs to ignore should not be '\
'larger than number of inplace outputs') 'larger than number of inplace outputs')
if (n_inplace_ignore < 0):
raise ValueError('n_inplace_ignore should be non-negative')
self.destroy_map = {} self.destroy_map = {}
if inplace: if inplace:
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论