提交 c49d6d8a authored 作者: Frederic Bastien's avatar Frederic Bastien

added better error msg. It was failing later with bizarre error.

上级 7755845c
...@@ -63,6 +63,11 @@ class Apply(utils.object2): ...@@ -63,6 +63,11 @@ class Apply(utils.object2):
self.inputs = [] self.inputs = []
self.tag = utils.scratchpad() self.tag = utils.scratchpad()
if not isinstance(inputs,(list,tuple)):
raise TypeError("The inputs of an Apply must be a list or tuple")
if not isinstance(outputs,(list,tuple)):
raise TypeError("The output of an Apply must be a list or tuple")
## filter inputs to make sure each element is a Variable ## filter inputs to make sure each element is a Variable
for input in inputs: for input in inputs:
if isinstance(input, Variable): if isinstance(input, Variable):
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论