提交 8f602f6f authored 作者: Pascal Lamblin's avatar Pascal Lamblin 提交者: sentient07

Fix sparse tests

Sparse types do not have a "broadcastable" attribute.
上级 1c2f0f4a
...@@ -635,7 +635,8 @@ def get_scalar_constant_value(orig_v, elemwise=True, ...@@ -635,7 +635,8 @@ def get_scalar_constant_value(orig_v, elemwise=True,
if isinstance(inp, Constant): if isinstance(inp, Constant):
return numpy.asarray(inp.data.shape[i]) return numpy.asarray(inp.data.shape[i])
# The shape of a broadcastable dimension is 1 # The shape of a broadcastable dimension is 1
if inp.type.broadcastable[i]: if (hasattr(inp.type, 'broadcastable') and
inp.type.broadcastable[i]):
return numpy.asarray(1) return numpy.asarray(1)
# Don't act as the constant_folding optimization here as this # Don't act as the constant_folding optimization here as this
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论