Skip to content

Commit

Permalink
Update random tests
Browse files Browse the repository at this point in the history
  • Loading branch information
antonwolfy committed Jan 14, 2025
1 parent d79dcb0 commit 2891cdb
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions dpnp/tests/third_party/cupy/random_tests/test_sample.py
Original file line number Diff line number Diff line change
Expand Up @@ -89,15 +89,15 @@ def test_bound_float2(self):
def test_goodness_of_fit(self):
mx = 5
trial = 100
vals = [random.randint(mx) for _ in range(trial)]
vals = [random.randint(mx).asnumpy() for _ in range(trial)]
counts = numpy.histogram(vals, bins=numpy.arange(mx + 1))[0]
expected = numpy.array([float(trial) / mx] * mx)
assert _hypothesis.chi_square_test(counts, expected)

@_condition.repeat(3, 10)
def test_goodness_of_fit_2(self):
mx = 5
vals = random.randint(mx, size=(5, 20))
vals = random.randint(mx, size=(5, 20)).asnumpy()
counts = numpy.histogram(vals, bins=numpy.arange(mx + 1))[0]
expected = numpy.array([float(vals.size) / mx] * mx)
assert _hypothesis.chi_square_test(counts, expected)
Expand Down Expand Up @@ -191,15 +191,15 @@ def test_bound_2(self):
def test_goodness_of_fit(self):
mx = 5
trial = 100
vals = [random.randint(0, mx) for _ in range(trial)]
vals = [random.randint(0, mx).asnumpy() for _ in range(trial)]
counts = numpy.histogram(vals, bins=numpy.arange(mx + 1))[0]
expected = numpy.array([float(trial) / mx] * mx)
assert _hypothesis.chi_square_test(counts, expected)

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

0 comments on commit 2891cdb

Please sign in to comment.