Skip to content

Commit 2891cdb

Browse files
committed
Update random tests
1 parent d79dcb0 commit 2891cdb

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

dpnp/tests/third_party/cupy/random_tests/test_sample.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -89,15 +89,15 @@ def test_bound_float2(self):
8989
def test_goodness_of_fit(self):
9090
mx = 5
9191
trial = 100
92-
vals = [random.randint(mx) for _ in range(trial)]
92+
vals = [random.randint(mx).asnumpy() for _ in range(trial)]
9393
counts = numpy.histogram(vals, bins=numpy.arange(mx + 1))[0]
9494
expected = numpy.array([float(trial) / mx] * mx)
9595
assert _hypothesis.chi_square_test(counts, expected)
9696

9797
@_condition.repeat(3, 10)
9898
def test_goodness_of_fit_2(self):
9999
mx = 5
100-
vals = random.randint(mx, size=(5, 20))
100+
vals = random.randint(mx, size=(5, 20)).asnumpy()
101101
counts = numpy.histogram(vals, bins=numpy.arange(mx + 1))[0]
102102
expected = numpy.array([float(vals.size) / mx] * mx)
103103
assert _hypothesis.chi_square_test(counts, expected)
@@ -191,15 +191,15 @@ def test_bound_2(self):
191191
def test_goodness_of_fit(self):
192192
mx = 5
193193
trial = 100
194-
vals = [random.randint(0, mx) for _ in range(trial)]
194+
vals = [random.randint(0, mx).asnumpy() for _ in range(trial)]
195195
counts = numpy.histogram(vals, bins=numpy.arange(mx + 1))[0]
196196
expected = numpy.array([float(trial) / mx] * mx)
197197
assert _hypothesis.chi_square_test(counts, expected)
198198

199199
@_condition.repeat(3, 10)
200200
def test_goodness_of_fit_2(self):
201201
mx = 5
202-
vals = random.randint(0, mx, (5, 20))
202+
vals = random.randint(0, mx, (5, 20)).asnumpy()
203203
counts = numpy.histogram(vals, bins=numpy.arange(mx + 1))[0]
204204
expected = numpy.array([float(vals.size) / mx] * mx)
205205
assert _hypothesis.chi_square_test(counts, expected)

0 commit comments

Comments
 (0)