Exemplo n.º 1
0
 def test_randn_invalid_argument(self):
     with self.assertRaises(TypeError):
         random.randn(1, 2, 3, unnecessary='unnecessary_argument')
Exemplo n.º 2
0
 def test_randn(self):
     with mock.patch('cupy.random.distributions.normal') as m:
         random.randn(1, 2, 3, dtype=numpy.float32)
     m.assert_called_once_with(size=(1, 2, 3), dtype=numpy.float32)
Exemplo n.º 3
0
 def test_randn_default_dtype(self):
     with mock.patch('cupy.random.distributions.normal') as m:
         random.randn(1, 2, 3)
     m.assert_called_once_with(size=(1, 2, 3), dtype=float)
Exemplo n.º 4
0
 def test_randn_invalid_argument(self):
     with self.assertRaises(TypeError):
         random.randn(1, 2, 3, unnecessary='unnecessary_argument')
Exemplo n.º 5
0
 def test_randn_default_dtype(self):
     random.distributions.normal = mock.Mock()
     random.randn(1, 2, 3)
     random.distributions.normal.assert_called_once_with(
         size=(1, 2, 3), dtype=float)
Exemplo n.º 6
0
 def test_randn(self):
     random.distributions.normal = mock.Mock()
     random.randn(1, 2, 3, dtype=numpy.float32)
     random.distributions.normal.assert_called_once_with(
         size=(1, 2, 3), dtype=numpy.float32)
Exemplo n.º 7
0
 def test_randn_default_dtype(self):
     random.distributions.normal = mock.Mock()
     random.randn(1, 2, 3)
     random.distributions.normal.assert_called_once_with(
         size=(1, 2, 3), dtype=float)
Exemplo n.º 8
0
 def test_randn(self):
     random.distributions.normal = mock.Mock()
     random.randn(1, 2, 3, dtype=numpy.float32)
     random.distributions.normal.assert_called_once_with(
         size=(1, 2, 3), dtype=numpy.float32)