Beispiel #1
0
    def test_get_random_state_with_cupy(self):
        rvs0 = self._get_rvs(generator.RandomState(6))

        os.environ['CUPY_SEED'] = '6'
        rvs1 = self._get_rvs_reset()

        self._check_same(rvs0, rvs1)
Beispiel #2
0
    def test_get_random_state_with_cupy_with_chainer_seed(self):
        rvs0 = self._get_rvs(generator.RandomState(7))

        os.environ['CUPY_SEED'] = '7'
        os.environ['CHAINER_SEED'] = '8'
        rvs1 = self._get_rvs_reset()

        self._check_same(rvs0, rvs1)
Beispiel #3
0
    def test_get_random_state_with_cupy_no_chainer_seed(self):
        rvs0 = self._get_rvs(generator.RandomState(6))

        os.environ['CUPY_SEED'] = '6'
        os.environ.pop('CHAINER_SEED', None)
        rvs1 = self._get_rvs_reset()

        self._check_same(rvs0, rvs1)
Beispiel #4
0
 def setUp(self):
     self.rs = generator.RandomState()
Beispiel #5
0
 def setUp(self):
     self.rs = generator.RandomState(seed=testing.generate_seed())
Beispiel #6
0
 def test_set_random_state_call_multiple_times(self):
     generator.set_random_state(generator.RandomState())
     rs = generator.RandomState()
     generator.set_random_state(rs)
     assert generator.get_random_state() is rs
Beispiel #7
0
 def test_set_random_state(self):
     rs = generator.RandomState()
     generator.set_random_state(rs)
     assert generator.get_random_state() is rs