class_docstr: Constructs a GLPN image processor.
  
  Args:
      do_resize (`bool`, *optional*, defaults to `True`):
          Set the class default for the `do_resize` parameter. Controls whether to resize the image's (height, width)
          dimensions, rounding them down to the closest multiple of `size_divisor`.
      size_divisor (`int`, *optional*, defaults to 32):
          Set the class default for the `size_divisor` parameter. When `do_resize` is `True`, images are resized so
          their height and width are rounded down to the closest multiple of `size_divisor`.
      resample (`PIL.Image` resampling filter, *optional*, defaults to `PIL.Image.Resampling.BILINEAR`):
          Set the class default for `resample`. Defines the resampling filter to use if resizing the image.
      do_rescale (`bool`, *optional*, defaults to `True`):
          Set the class default for the `do_rescale` parameter. Controls whether or not to apply the scaling factor
          (to make pixel values floats between 0. and 1.).
docstr: Rescale the image by the given scaling factor `scale`.
  
  Args:
      image (`np.ndarray`):
          The image to rescale.
      scale (`float`):
          The scaling factor to rescale pixel values by.
      data_format (`ChannelDimension`, *optional*):
          The channel dimension format for the output image. If `None`, the channel dimension format of the input
          image is used. Can be one of:
          - `ChannelDimension.FIRST`: image in (num_channels, height, width) format.
          - `ChannelDimension.LAST`: image in (height, width, num_channels) format.
  
  Returns:
      `np.ndarray`: The rescaled image.
docstr_tok: ["Rescale","the","image","by","the","given","scaling","factor","`","scale","`",".","Args",":","image","(","`","np.ndarray","`",")",":","The","image","to","rescale",".","scale","(","`","float","`",")",":","The","scaling","factor","to","rescale","pixel","values","by",".","data_format","(","`","ChannelDimension","`",",","*","optional","*",")",":","The","channel","dimension","format","for","the","output","image",".","If","`","None","`",",","the","channel","dimension","format","of","the","input","image","is","used",".","Can","be","one","of",":","-","`","ChannelDimension.FIRST","`",":","image","in","(","num_channels",",","height",",","width",")","format",".","-","`","ChannelDimension.LAST","`",":","image","in","(","height",",","width",",","num_channels",")","format",".","Returns",":","`","np.ndarray","`",":","The","rescaled","image","."]
code: def rescale(
      self,
      image: np.ndarray,
      scale: float,
      data_format: Optional[ChannelDimension] = None,
      **kwargs,
  ) -> np.ndarray:
      """
      Rescale the image by the given scaling factor `scale`.
  
      Args:
          image (`np.ndarray`):
              The image to rescale.
          scale (`float`):
              The scaling factor to rescale pixel values by.
          data_format (`ChannelDimension`, *optional*):
              The channel dimension format for the output image. If `None`, the channel dimension format of the input
              image is used. Can be one of:
              - `ChannelDimension.FIRST`: image in (num_channels, height, width) format.
              - `ChannelDimension.LAST`: image in (height, width, num_channels) format.
  
      Returns:
          `np.ndarray`: The rescaled image.
      """
      return rescale(
          image=image, scale=scale, data_format=data_format, **kwargs
      )
  
file_path: H2O/h2o_flexgen/benchmark/third_party/transformers/src/transformers/models/glpn/image_processing_glpn.py
imports: from typing import List, Optional, Union
  import numpy
  import PIL.Image
  from transformers.image_utils import PILImageResampling
  from transformers.utils.generic import TensorType
  from ...image_processing_utils import BaseImageProcessor, BatchFeature
  from ...image_transforms import rescale, resize, to_channel_dimension_format
  from ...image_utils import ChannelDimension, get_image_size, is_batched, to_numpy_array, valid_images
  from ...utils import logging
label_desc: Use image node_id 3 for calling the GLPNImageProcessor obj's underlying member method code with example usage: obj.rescale(image, scale, data_format) and returns: rescale