Skip to content

Add support of high=None in dpnp.random.randint() function #1284

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion dpnp/random/dpnp_random_state.py
Original file line number Diff line number Diff line change
Expand Up @@ -337,7 +337,7 @@ def randint(self, low, high=None, size=None, dtype=int, usm_type="device"):
if not use_origin_backend(low):
if not dpnp.isscalar(low):
pass
elif not dpnp.isscalar(high):
elif not (high is None or dpnp.isscalar(high)):
pass
else:
_dtype = dpnp.int32 if dtype is int else dpnp.dtype(dtype)
Expand Down
2 changes: 0 additions & 2 deletions tests/third_party/cupy/random_tests/test_sample.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@ def test_lo_hi_nonrandom(self):
a = random.randint(-1.1, -0.9, size=(2, 2))
numpy.testing.assert_array_equal(a, cupy.full((2, 2), -1))

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


@pytest.mark.usefixtures("allow_fall_back_on_numpy")
@testing.gpu
class TestRandintDtype(unittest.TestCase):

Expand Down