@@ -473,10 +473,9 @@ def test_distr(self, usm_type):
473
473
data = RandomState (seed , sycl_queue = sycl_queue ).randn (3 , 2 , usm_type = usm_type )
474
474
assert_array_almost_equal (data .asnumpy (), desired , decimal = precision )
475
475
476
- # TODO: discuss with oneMKL: return 0.0 instead of the 1st element
477
476
# call with omitted dimensions has to draw the first element from desired
478
- # actual = dpnp.asnumpy(RandomState(seed).randn(usm_type=usm_type))
479
- # assert_array_almost_equal(actual, desired[0, 0], decimal=precision)
477
+ actual = dpnp .asnumpy (RandomState (seed ).randn (usm_type = usm_type ))
478
+ assert_array_almost_equal (actual , desired [0 , 0 ], decimal = precision )
480
479
481
480
# randn() is an alias on standard_normal(), map arguments
482
481
with mock .patch ('dpnp.random.RandomState.standard_normal' ) as m :
@@ -622,10 +621,13 @@ def test_distr(self, usm_type):
622
621
precision = numpy .finfo (dtype = numpy .float32 ).precision
623
622
assert_array_almost_equal (data .asnumpy (), desired , decimal = precision )
624
623
625
- # TODO: discuss with oneMKL: return 0.0 instead of the 1st element
624
+ # call with the same seed has to draw the same values
625
+ data = RandomState (seed , sycl_queue = sycl_queue ).standard_normal (size = (4 , 2 ), usm_type = usm_type )
626
+ assert_array_almost_equal (data .asnumpy (), desired , decimal = precision )
627
+
626
628
# call with omitted dimensions has to draw the first element from desired
627
- # actual = dpnp.asnumpy(RandomState(seed).standard_normal(usm_type=usm_type))
628
- # assert_array_almost_equal(actual, desired[0, 0], decimal=precision)
629
+ actual = dpnp .asnumpy (RandomState (seed ).standard_normal (usm_type = usm_type ))
630
+ assert_array_almost_equal (actual , desired [0 , 0 ], decimal = precision )
629
631
630
632
# random_sample() is an alias on uniform(), map arguments
631
633
with mock .patch ('dpnp.random.RandomState.normal' ) as m :
0 commit comments