class_docstr: Base class for Gym space serializers.
  
  Attrs:
    space_type: (type) Gym space class that this SpaceSerializer corresponds
      to. Should be defined in subclasses.
    representation_length: (int) Number of symbols in the representation of
      every element of the space.
    significance_map: (np.ndarray) Integer array of the same size as the
      discrete representation, where elements describe the significance of
      symbols, e.g. in fixed-precision encoding. 0 is the most significant
      symbol, 1 the second most significant etc.
class_docstr_tok: ["Base","class","for","Gym","space","serializers",".","Attrs",":","space_type",":","(","type",")","Gym","space","class","that","this","SpaceSerializer","corresponds","to",".","Should","be","defined","in","subclasses",".","representation_length",":","(","int",")","Number","of","symbols","in","the","representation","of","every","element","of","the","space",".","significance_map",":","(","np.ndarray",")","Integer","array","of","the","same","size","as","the","discrete","representation",",","where","elements","describe","the","significance","of","symbols",",","e.g",".","in","fixed-precision","encoding",".","0","is","the","most","significant","symbol",",","1","the","second","most","significant","etc","."]
docstr: Serializes a batch of space elements into discrete sequences.
  
  Should be defined in subclasses.
  
  Args:
    data: A batch of batch_size elements of the Gym space to be serialized.
  
  Returns:
    int32 array of shape (batch_size, self.representation_length).
docstr_tok: ["Serializes","a","batch","of","space","elements","into","discrete","sequences",".","Should","be","defined","in","subclasses",".","Args",":","data",":","A","batch","of","batch_size","elements","of","the","Gym","space","to","be","serialized",".","Returns",":","int32","array","of","shape","(","batch_size",",","self.representation_length",")","."]
code: def serialize(self, data):
      """Serializes a batch of space elements into discrete sequences.
  
      Should be defined in subclasses.
  
      Args:
        data: A batch of batch_size elements of the Gym space to be serialized.
  
      Returns:
        int32 array of shape (batch_size, self.representation_length).
      """
      raise NotImplementedError
  
imports: import copy
  from absl import logging
  import gin
  import gym
  from jax import numpy
label_desc: Use image node_id 3 for calling the SpaceSerializer obj's underlying member method code with example usage: obj.serialize(data) without return types