Beispiel #1
0
 def test_unflatten_n_tuple(self):
     box = Box(0.0, 1.0, (3, 4))
     obs = ((([1, 2, 3], [3, 4, 5], [5, 6, 7],
              [7, 8, 9]), ([1, 2, 3], [3, 4, 5], [5, 6, 7], [7, 8, 9]),
             ([1, 2, 3], [3, 4, 5], [5, 6, 7], [7, 8, 9])))
     arr = box.unflatten_n(obs)
     assert arr.shape == (3, 3, 4)
Beispiel #2
0
 def test_unflatten_n(self):
     box = Box(0.0, 1.0, (3, 4))
     obs = np.asarray((([1, 2, 3], [3, 4, 5], [5, 6, 7], [7, 8, 9]),
                       ([1, 2, 3], [3, 4, 5], [5, 6, 7], [7, 8, 9]),
                       ([1, 2, 3], [3, 4, 5], [5, 6, 7], [7, 8, 9])))
     arr = box.unflatten_n(obs)
     assert obs.shape == (3, 4, 3)
     assert arr.shape == (3, 3, 4)