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

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

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