class_docstr: Discretizes a continuous action space into a discrete action space, allowing the usage of
  agents such as DQN for continuous environments such as MuJoCo. Given the number of bins to discretize into, the
  original continuous action space is uniformly separated into the given number of bins, each mapped to a discrete
  action index. Each discrete action is mapped to a single N dimensional action in the BoxActionSpace action space.
  For example, if the original actions space is between -1 and 1 and 5 bins were selected, the new action
  space will consist of 5 actions mapped to -1, -0.5, 0, 0.5 and 1.
code: def validate_output_action_space(
      self, output_action_space: BoxActionSpace
  ):
      if not isinstance(output_action_space, BoxActionSpace):
          raise ValueError(
              "BoxActionSpace discretization only works with an output space of type BoxActionSpace. "
              "The given output space is {}".format(output_action_space)
          )
  
      if len(self.num_bins_per_dimension) != output_action_space.shape:
          # TODO: this check is not sufficient. it does not deal with actions spaces with more than one axis
          raise ValueError(
              "The length of the list of bins per dimension ({}) does not match the number of "
              "dimensions in the action space ({})".format(
                  len(self.num_bins_per_dimension), output_action_space
              )
          )
  
file_path: coach/rl_coach/filters/action/box_discretization.py
imports: from itertools import product
  from typing import Union, List
  import numpy
  from rl_coach.filters.action.partial_discrete_action_space_map import PartialDiscreteActionSpaceMap
  from rl_coach.spaces import BoxActionSpace, DiscreteActionSpace
label_desc: Use image node_id 2 for calling the BoxDiscretization obj's underlying member method code with example usage: obj.validate_output_action_space(output_action_space) without return types