class_docstr: Wraps an environment with continuous actions and discretizes them.
  
  This is a simplified adaptation of ActionDiscretizeWrapper
  from tf_agents.
docstr: Generates a discrete bounded spec and a linspace for the given limits.
  
  Args:
    env: An array to discretize.
  
  Returns:
    Tuple with the discrete_spec along with a list of lists mapping actions.
  Raises:
    ValueError: If not all limits value are >=2 or maximum or minimum of boxes
    is equal to +- infinity.
docstr_tok: ["Generates","a","discrete","bounded","spec","and","a","linspace","for","the","given","limits",".","Args",":","env",":","An","array","to","discretize",".","Returns",":","Tuple","with","the","discrete_spec","along","with","a","list","of","lists","mapping","actions",".","Raises",":","ValueError",":","If","not","all","limits","value","are",">","=2","or","maximum","or","minimum","of","boxes","is","equal","to","+-","infinity","."]
code: def _discretize_env(self, env):
      """Generates a discrete bounded spec and a linspace for the given limits.
  
      Args:
        env: An array to discretize.
  
      Returns:
        Tuple with the discrete_spec along with a list of lists mapping actions.
      Raises:
        ValueError: If not all limits value are >=2 or maximum or minimum of boxes
        is equal to +- infinity.
      """
      if not np.all(self._num_actions >= 2):
          raise ValueError("num_actions should all be at least size 2.")
  
      if math.isinf(np.min(env.action_space.low)) or math.isinf(
          np.max(env.action_space.high)
      ):
          raise ValueError(
              """Minimum of boxes is {} and maximum of boxes is {},
            but we expect that finite values are provided.""".format(
                  np.min(env.action_space.low),
                  np.max(env.action_space.high),
              )
          )
  
      limits = np.broadcast_to(
          self._num_actions, env.action_space.shape
      )
      minimum = np.broadcast_to(
          np.min(env.action_space.low), env.action_space.shape
      )
      maximum = np.broadcast_to(
          np.max(env.action_space.high), env.action_space.shape
      )
  
      action_map = [
          np.linspace(env_min, env_max, num=n_actions)
          for env_min, env_max, n_actions in zip(
              np.nditer(minimum), np.nditer(maximum), np.nditer(limits)
          )
      ]
  
      return action_map
  
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  import math
  from absl import logging
  import gym
  import gym.wrappers
  import numpy
  from PIL import Image
label_desc: Use image node_id 2 for calling the ActionDiscretizeWrapper obj's underlying member method code with example usage: obj._discretize_env(env) and returns: action_map