Skip to content

Commit

Permalink
Update tests for random state
Browse files Browse the repository at this point in the history
  • Loading branch information
antonwolfy committed Jan 20, 2025
1 parent 3a9b7f6 commit f77d8de
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions dpnp/tests/test_random_state.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
from dpnp.dpnp_array import dpnp_array
from dpnp.random import RandomState

from .helper import is_cpu_device
from .helper import get_array, is_cpu_device

# aspects of default device:
_def_device = dpctl.SyclQueue().sycl_device
Expand Down Expand Up @@ -224,7 +224,7 @@ def test_fallback(self, loc, scale):
# dpnp accepts only scalar as low and/or high, in other cases it will be a fallback to numpy
actual = data.asnumpy()
expected = numpy.random.RandomState(seed).normal(
loc=loc, scale=scale, size=size
loc=get_array(numpy, loc), scale=get_array(numpy, scale), size=size
)

dtype = get_default_floating()
Expand Down Expand Up @@ -557,7 +557,7 @@ def test_bounds_fallback(self, low, high):
RandomState(seed).randint(low=low, high=high, size=size).asnumpy()
)
expected = numpy.random.RandomState(seed).randint(
low=low, high=high, size=size
low=get_array(numpy, low), high=get_array(numpy, high), size=size
)
assert_equal(actual, expected)

Expand Down Expand Up @@ -1139,7 +1139,7 @@ def test_fallback(self, low, high):
# dpnp accepts only scalar as low and/or high, in other cases it will be a fallback to numpy
actual = data.asnumpy()
expected = numpy.random.RandomState(seed).uniform(
low=low, high=high, size=size
low=get_array(numpy, low), high=get_array(numpy, high), size=size
)

dtype = get_default_floating()
Expand Down

0 comments on commit f77d8de

Please sign in to comment.