class_docstr: Rescales an image observation by some factor. For example, the image size
  can be reduced by a factor of 2.
code: def validate_input_observation_space(
      self, input_observation_space: ObservationSpace
  ):
      if not 2 <= input_observation_space.num_dimensions <= 3:
          raise ValueError(
              "The rescale filter only applies to image observations where the number of dimensions is"
              "either 2 (grayscale) or 3 (RGB). The number of dimensions defined for the "
              "output observation was {}".format(
                  input_observation_space.num_dimensions
              )
          )
      if (
          input_observation_space.num_dimensions == 3
          and input_observation_space.shape[-1] != 3
      ):
          raise ValueError(
              "Observations with 3 dimensions must have 3 channels in the last axis (RGB)"
          )
  
file_path: coach/rl_coach/filters/observation/observation_rescale_size_by_factor_filter.py
imports: from skimage.transform import resize
  from rl_coach.core_types import ObservationType
  from rl_coach.filters.observation.observation_filter import ObservationFilter
  from rl_coach.spaces import ObservationSpace
label_desc: Use image node_id 2 for calling the ObservationRescaleSizeByFactorFilter obj's underlying member method code with example usage: obj.validate_input_observation_space(input_observation_space) without return types