Skip to content

Commit

Permalink
Update test_random.py
Browse files Browse the repository at this point in the history
  • Loading branch information
mtar authored Dec 6, 2023
1 parent 6f2495f commit 5d05ab5
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions heat/core/tests/test_random.py
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ def test_permutation(self):

with self.assertRaises(TypeError):
ht.random.permutation("abc")

"""
def test_rand(self):
# int64 tests
Expand Down Expand Up @@ -234,7 +234,8 @@ def test_rand(self):
ht.random.randn(6667, 3523, dtype=ht.float64, split=None)
ht.random.randn(6667, 3523, dtype=ht.float64, split=0)
ht.random.randn(6667, 3523, dtype=ht.float64, split=1)

"""
"""
def test_randint(self):
# Checked that the random values are in the correct range
a = ht.random.randint(low=0, high=10, size=(10, 10), dtype=ht.int64)
Expand Down Expand Up @@ -343,7 +344,8 @@ def test_randint(self):
ht.random.seed(234)
b = ht.random.random_integer(10, 50)
self.assertTrue(ht.equal(a, b))

"""
"""
def test_randn(self):
# Test that the random values have the correct distribution
ht.random.seed(54321)
Expand Down Expand Up @@ -408,7 +410,7 @@ def test_randn(self):
c = ht.random.randn(30, 30, 30, dtype=ht.float32, split=2).numpy()
self.assertFalse(np.allclose(a, c))
self.assertFalse(np.allclose(b, c))

"""
def test_randperm(self):
if self.device.torch_device == "cpu":
state = torch.random.get_rng_state()
Expand Down

0 comments on commit 5d05ab5

Please sign in to comment.