class_docstr: Serializer for gym.spaces.Box.
  
  Assumes that the space is bounded. Internally rescales it to the [0, 1]
  interval and uses a fixed-precision encoding.
class_docstr_tok: ["Serializer","for","gym.spaces.Box",".","Assumes","that","the","space","is","bounded",".","Internally","rescales","it","to","the","[","0",",","1","]","interval","and","uses","a","fixed-precision","encoding","."]
code: def serialize(self, data):
      array = data
      batch_size = array.shape[0]
      array = (array - self._space.low) / (
          self._space.high - self._space.low
      )
      array = np.clip(array, 0, 1)
      digits = []
      for digit_index in range(-1, -self._precision - 1, -1):
          threshold = self._vocab_size**digit_index
          digit = np.array(array / threshold).astype(np.int32)
          # For the corner case of x == high.
          digit = np.where(digit == self._vocab_size, digit - 1, digit)
          digits.append(digit)
          array -= digit * threshold
      digits = np.stack(digits, axis=-1)
      return np.reshape(digits, (batch_size, -1))
  
imports: import copy
  from absl import logging
  import gin
  import gym
  from jax import numpy
label_desc: Use image node_id 2 for calling the BoxSpaceSerializer obj's underlying member method code with example usage: obj.serialize(data) and returns: np