提交 b69b8747 authored 作者: James Bergstra's avatar James Bergstra

get_constant_value uses numpy.complex() now instead of complex() since I added

the complex symbol to tensor.basic
上级 a9039aa9
......@@ -342,10 +342,10 @@ def get_constant_value(v):
# it is not a constant, but in some cases it *could* be replaced with one.
# Note that this would have an effect on the broadcasting of inputs and so on
try:
complex(v.data) #works for all numeric scalars
numpy.complex(v.data) #works for all numeric scalars
return v.data
except:
raise TypeError(v)
raise TypeError('v.data is non-numeric', v)
if v.owner:
if isinstance(v.owner.op, Alloc):
return get_constant_value(v.owner.inputs[0])
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论