Skip to content

Commit 9308f64

Browse files
authored
Support high=None in dpnp.randint() (#1284)
1 parent cb3421c commit 9308f64

File tree

2 files changed

+1
-3
lines changed

2 files changed

+1
-3
lines changed

dpnp/random/dpnp_random_state.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -337,7 +337,7 @@ def randint(self, low, high=None, size=None, dtype=int, usm_type="device"):
337337
if not use_origin_backend(low):
338338
if not dpnp.isscalar(low):
339339
pass
340-
elif not dpnp.isscalar(high):
340+
elif not (high is None or dpnp.isscalar(high)):
341341
pass
342342
else:
343343
_dtype = dpnp.int32 if dtype is int else dpnp.dtype(dtype)

tests/third_party/cupy/random_tests/test_sample.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,6 @@ def test_lo_hi_nonrandom(self):
3333
a = random.randint(-1.1, -0.9, size=(2, 2))
3434
numpy.testing.assert_array_equal(a, cupy.full((2, 2), -1))
3535

36-
@pytest.mark.usefixtures("allow_fall_back_on_numpy")
3736
def test_zero_sizes(self):
3837
a = random.randint(10, size=(0,))
3938
numpy.testing.assert_array_equal(a, cupy.array(()))
@@ -112,7 +111,6 @@ def test_goodness_of_fit_2(self):
112111
self.assertTrue(hypothesis.chi_square_test(counts, expected))
113112

114113

115-
@pytest.mark.usefixtures("allow_fall_back_on_numpy")
116114
@testing.gpu
117115
class TestRandintDtype(unittest.TestCase):
118116

0 commit comments

Comments
 (0)