提交 51f6b75a authored 作者: Frederic's avatar Frederic

Generalize the error message to help work around a travis failure.

上级 57fed426
...@@ -4,8 +4,6 @@ import StringIO ...@@ -4,8 +4,6 @@ import StringIO
import sys import sys
import traceback import traceback
import numpy
import theano import theano
from theano.gof import utils from theano.gof import utils
from theano.gof import graph from theano.gof import graph
...@@ -124,12 +122,9 @@ def raise_with_op(op, thunk=None, exc_info=None): ...@@ -124,12 +122,9 @@ def raise_with_op(op, thunk=None, exc_info=None):
for ipt in thunk.inputs] for ipt in thunk.inputs]
scalar_values = [] scalar_values = []
for ipt in thunk.inputs: for ipt in thunk.inputs:
if (isinstance(ipt[0], (numpy.ndarray, numpy.number)) and
ipt[0].size == 1):
if getattr(ipt[0], "size", -1) == 1: if getattr(ipt[0], "size", -1) == 1:
scalar_values.append(ipt[0].item(0)) scalar_values.append(ipt[0])
continue else:
scalar_values.append("not scalar") scalar_values.append("not scalar")
else: else:
shapes = "The thunk don't have an inputs attributes." shapes = "The thunk don't have an inputs attributes."
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论