class_docstr: Rescales an image observation to a given size. The target size does not
  necessarily keep the aspect ratio of the original observation.
  Warning: this requires the input observation to be of type uint8 due to scipy requirements!
code: def validate_input_observation_space(
      self, input_observation_space: ObservationSpace
  ):
      if not isinstance(
          input_observation_space, PlanarMapsObservationSpace
      ):
          raise ValueError(
              "The rescale filter only applies to observation spaces that inherit from "
              "PlanarMapsObservationSpace. This includes observations which consist of a set of 2D "
              "images or an RGB image. Instead the input observation space was defined as: {}".format(
                  input_observation_space.__class__
              )
          )
      if (
          input_observation_space.shape[
              input_observation_space.channels_axis
          ]
          != self.output_observation_space.shape[
              self.output_observation_space.channels_axis
          ]
      ):
          raise ValueError(
              "The number of channels between the input and output observation spaces must match. "
              "Instead the number of channels were: {}, {}".format(
                  input_observation_space.shape[
                      input_observation_space.channels_axis
                  ],
                  self.output_observation_space.shape[
                      self.output_observation_space.channels_axis
                  ],
              )
          )
  
file_path: coach/rl_coach/filters/observation/observation_rescale_to_size_filter.py
imports: import copy
  from skimage.transform import resize
  import numpy
  from rl_coach.core_types import ObservationType
  from rl_coach.filters.observation.observation_filter import ObservationFilter
  from rl_coach.spaces import ObservationSpace, PlanarMapsObservationSpace, ImageObservationSpace
label_desc: Use image node_id 2 for calling the ObservationRescaleToSizeFilter obj's underlying member method code with example usage: obj.validate_input_observation_space(input_observation_space) without return types