Enables to use CompositeSpace types as input to a network, or as an output
v2: fix pep8
v3: move the helper function to utils
Signed-off-by: Axel Davy <axel.davy@ens.fr>