docstr: Resize image.
docstr_tok: ["Resize","image","."]
code: def resize(
      self,
      image: [PIL.Image.Image, np.ndarray, torch.Tensor],
      height: Optional[int] = None,
      width: Optional[int] = None,
  ) -> [PIL.Image.Image, np.ndarray, torch.Tensor]:
      """
      Resize image.
      """
      if isinstance(image, PIL.Image.Image):
          image = image.resize(
              (width, height),
              resample=PIL_INTERPOLATION[self.config.resample],
          )
      elif isinstance(image, torch.Tensor):
          image = torch.nn.functional.interpolate(
              image, size=(height, width)
          )
      elif isinstance(image, np.ndarray):
          image = self.numpy_to_pt(image)
          image = torch.nn.functional.interpolate(
              image, size=(height, width)
          )
          image = self.pt_to_numpy(image)
      return image
  
imports: import warnings
  from typing import List, Optional, Union
  import numpy
  import PIL
  import torch
  from diffusers import ConfigMixin
  from diffusers.image_processor import VaeImageProcessor
  from diffusers.utils.pil_utils import PIL_INTERPOLATION
  from PIL import Image
  from tqdm.auto import tqdm
label_desc: Use image node_id 8 for calling the VaeImageProcessor obj's underlying member method code with example usage: obj.resize(image, height, width) and returns: image