Beispiel #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)
Beispiel #2
0
 def test_choose_backend_list_of_variables(self):
     with mock.patch('pymc3.sampling.NDArray') as nd:
         sampling._choose_backend(['var1', 'var2'], 'chain')
     nd.assert_called_with(vars=['var1', 'var2'])
Beispiel #3
0
 def test_choose_backend_none(self):
     with mock.patch('pymc3.sampling.NDArray') as nd:
         sampling._choose_backend(None, 'chain')
     self.assertTrue(nd.called)
Beispiel #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)
Beispiel #5
0
 def test_choose_backend_list_of_variables(self):
     with mock.patch('pymc3.sampling.NDArray') as nd:
         sampling._choose_backend(['var1', 'var2'], 'chain')
     nd.assert_called_with(vars=['var1', 'var2'])
Beispiel #6
0
 def test_choose_backend_none(self):
     with mock.patch('pymc3.sampling.NDArray') as nd:
         sampling._choose_backend(None, 'chain')
     self.assertTrue(nd.called)