Esempio n. 1
0
 def test_choose_backend_shortcut(self):
     backend = mock.Mock()
     shortcuts = {'test_backend': {'backend': backend,
                                   'name': None}}
     sampling._choose_backend('test_backend', 'chain', shortcuts=shortcuts)
     self.assertTrue(backend.called)
Esempio n. 2
0
 def test_choose_backend_list_of_variables(self):
     with mock.patch('pymc.sampling.NDArray') as nd:
         sampling._choose_backend(['var1', 'var2'], 'chain')
     nd.assert_called_with(vars=['var1', 'var2'])
Esempio n. 3
0
 def test_choose_backend_none(self):
     with mock.patch('pymc.sampling.NDArray') as nd:
         sampling._choose_backend(None, 'chain')
     self.assertTrue(nd.called)
Esempio n. 4
0
 def test_choose_backend_shortcut(self):
     backend = mock.Mock()
     shortcuts = {'test_backend': {'backend': backend, 'name': None}}
     sampling._choose_backend('test_backend', 'chain', shortcuts=shortcuts)
     self.assertTrue(backend.called)
Esempio n. 5
0
 def test_choose_backend_list_of_variables(self):
     with mock.patch('pymc.sampling.NDArray') as nd:
         sampling._choose_backend(['var1', 'var2'], 'chain')
     nd.assert_called_with(vars=['var1', 'var2'])
Esempio n. 6
0
 def test_choose_backend_none(self):
     with mock.patch('pymc.sampling.NDArray') as nd:
         sampling._choose_backend(None, 'chain')
     self.assertTrue(nd.called)