提交 092b8e2c authored 作者: Frederic Bastien's avatar Frederic Bastien 提交者: Alexander Belopolsky

Enable optimization on numpy interger, not just python int.

This is needed as a previous commit changed some python int to numpy integer. This will also make the optimization happen more frequently then before.
上级 62861303
......@@ -1625,7 +1625,7 @@ def local_useless_subtensor(node):
except NotScalarConstantError:
pass
if isinstance(idx.stop, int):
if isinstance(idx.stop, (int, numpy.integer)):
if idx.stop < length_pos_data:
return False
elif isinstance(idx.stop, theano.scalar.Scalar):
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论