예제 #1
0
 def test_dtype(self):
     p = policy.DiscretePolicy(1, dtype=np.float32)
     self.assertEqual(p.action_space.dtype, np.float32)
     p = policy.DiscretePolicy(gym.spaces.Discrete(1), dtype=np.uint8)
     self.assertEqual(p.action_space.dtype, np.uint8)
예제 #2
0
 def test_int(self):
     p = policy.DiscretePolicy(1)
     self.assertEqual(p.action_space.n, 1)
     self.assertEqual(p.action_space.dtype, np.int64)
예제 #3
0
 def test_sampler(self):
     with self.assertRaises(NotImplementedError):
         p = policy.DiscretePolicy(1)
         p(None)
예제 #4
0
 def test_discrete(self):
     policy.DiscretePolicy(gym.spaces.Discrete(1))
예제 #5
0
 def test_0(self):
     with self.assertRaises(AssertionError):
         policy.DiscretePolicy(0)