提交 5843edc1 authored 作者: Pascal Lamblin's avatar Pascal Lamblin

Check indexing with too big a long raises an error

上级 0c601632
......@@ -3006,6 +3006,12 @@ class T_subtensor(unittest.TestCase, utt.TestOptimizationMixin):
self.assertTrue(tval.shape == (2,))
self.assertTrue(numpy.all(tval == [4, 10]))
def test_long_too_big(self):
# Currently, we cast Python longs to int64 when used for indexing.
# This test checks that using a long that does not fit raises an error.
n = self.shared(numpy.arange(12, dtype=self.dtype).reshape((4, 3)))
self.assertRaises(Exception, lambda: n[:(2L ** 63)])
def test_newaxis(self):
"""
newaxis support comes from logic in the __getitem__ of TensorType
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论