コード例 #1
0
 def test_rand_invalid_argument(self):
     with self.assertRaises(TypeError):
         random.rand(1, 2, 3, unnecessary='unnecessary_argument')
コード例 #2
0
 def test_rand(self):
     with mock.patch('cupy.random.sample_.random_sample') as m:
         random.rand(1, 2, 3, dtype=numpy.float32)
     m.assert_called_once_with(size=(1, 2, 3), dtype=numpy.float32)
コード例 #3
0
 def test_rand_default_dtype(self):
     with mock.patch('cupy.random.sample_.random_sample') as m:
         random.rand(1, 2, 3)
     m.assert_called_once_with(size=(1, 2, 3), dtype=float)
コード例 #4
0
ファイル: test_sample.py プロジェクト: hitottiez/chainer
 def test_rand_invalid_argument(self):
     with self.assertRaises(TypeError):
         random.rand(1, 2, 3, unnecessary='unnecessary_argument')
コード例 #5
0
ファイル: test_sample.py プロジェクト: hitottiez/chainer
 def test_rand_default_dtype(self):
     random.sample_.random_sample = mock.Mock()
     random.rand(1, 2, 3)
     random.sample_.random_sample.assert_called_once_with(
         size=(1, 2, 3), dtype=float)
コード例 #6
0
ファイル: test_sample.py プロジェクト: hitottiez/chainer
 def test_rand(self):
     random.sample_.random_sample = mock.Mock()
     random.rand(1, 2, 3, dtype=numpy.float32)
     random.sample_.random_sample.assert_called_once_with(
         size=(1, 2, 3), dtype=numpy.float32)
コード例 #7
0
ファイル: test_sample.py プロジェクト: zhouyonglong/cupy
 def test_rand_default_dtype(self):
     random.sample_.random_sample = mock.Mock()
     random.rand(1, 2, 3)
     random.sample_.random_sample.assert_called_once_with(
         size=(1, 2, 3), dtype=float)
コード例 #8
0
ファイル: test_sample.py プロジェクト: zhouyonglong/cupy
 def test_rand(self):
     random.sample_.random_sample = mock.Mock()
     random.rand(1, 2, 3, dtype=numpy.float32)
     random.sample_.random_sample.assert_called_once_with(
         size=(1, 2, 3), dtype=numpy.float32)