def __init__(self, space, vocab_size):
    """Creates a SpaceSerializer.

    Subclasses should retain the signature.

    Args:
      space: (gym.Space) Gym space of type self.space_type.
      vocab_size: (int) Number of symbols in the vocabulary.
    """
    assert isinstance(space, self.space_type)
    self._space = space
    self._vocab_size = vocab_size
Creates a SpaceSerializer.

    Subclasses should retain the signature.

    Args:
      space: (gym.Space) Gym space of type self.space_type.
      vocab_size: (int) Number of symbols in the vocabulary.
    
trax/rl/space_serializer.py