Пример #1
0
 def test_unflatten(self):
     disc = Discrete(10)
     x = [3, 5, 7]
     arr = disc.flatten(x)
     assert disc.unflatten(arr) == 3
Пример #2
0
 def test_flatten(self):
     disc = Discrete(10)
     x = [3, 5, 7]
     arr = disc.flatten(x)
     assert all(arr[x] == 1)