Relax dtype tests on `_interval` outputs
@@ -863,7 +863,7 @@ class TestInterval(RandomGeneratorTestCase):
vals = self.generate_many(0, shape, _count=10)
for val in vals:
assert isinstance(val, cupy.ndarray)
- assert val.dtype == numpy.int32
+ assert val.dtype.kind in 'iu'
assert val.shape == shape
assert (val == 0).all()
@@ -872,7 +872,7 @@ class TestInterval(RandomGeneratorTestCase):
vals = self.generate_many(mx, None, _count=10)
for val in vals:
assert isinstance(val, cupy.ndarray)
- assert val.dtype == numpy.int32
+ assert val.dtype.kind in 'iu'
assert val.shape == ()
assert (0 <= val).all()
assert (val <= mx).all()
@@ -884,7 +884,7 @@ class TestInterval(RandomGeneratorTestCase):
vals = self.generate_many(mx, size, _count=10)
for val in vals:
assert isinstance(val, cupy.ndarray)
- assert val.dtype == numpy.int32
+ assert val.dtype.kind in 'iu'
assert val.shape == (size,)
assert (0 <= val).all()
assert (val <= mx).all()
@@ -896,31 +896,17 @@ class TestInterval(RandomGeneratorTestCase):
vals = self.generate_many(mx, shape, _count=10)
for val in vals:
assert isinstance(val, cupy.ndarray)
- assert val.dtype == numpy.int32
+ assert val.dtype.kind in 'iu'
assert val.shape == shape
assert (0 <= val).all()
assert (val <= mx).all()
# TODO(niboshi): Distribution test
- def test_int32_range(self):
- v = self.generate(0x00000000, 2)
- assert v.dtype == numpy.int32
-
- v = self.generate(0x7fffffff, 2)
- assert v.dtype == numpy.int32
-
- def test_uint32_range(self):
- v = self.generate(0x80000000, 2)
- assert v.dtype == numpy.uint32
-
- v = self.generate(0xffffffff, 2)
- assert v.dtype == numpy.uint32
-
def test_bound_1(self):
vals = self.generate_many(10, (2, 3), _count=10)
for val in vals:
assert isinstance(val, cupy.ndarray)
- assert val.dtype == numpy.int32
+ assert val.dtype.kind in 'iu'
assert val.shape == (2, 3)
assert (0 <= val).all()
assert (val <= 10).all()
@@ -929,7 +915,7 @@ class TestInterval(RandomGeneratorTestCase):
vals = self.generate_many(2, None, _count=20)
for val in vals:
assert isinstance(val, cupy.ndarray)
- assert val.dtype == numpy.int32
+ assert val.dtype.kind in 'iu'
assert val.shape == ()
assert (0 <= val).all()
assert (val <= 2).all()
