parameters: (image,
                               target_height,
                               target_width,
                               method=ResizeMethod.BILINEAR,
                               antialias=False)
return_statement: return _resize_image_with_pad_common(image, target_height, target_width,
                                         _resize_fn)
docstring: Resizes and pads an image to a target width and height.
  
    Resizes an image to a target width and height by keeping
    the aspect ratio the same without distortion. If the target
    dimensions don't match the image dimensions, the image
    is resized and then padded with zeroes to match requested
    dimensions.
  
    Args:
      image: 4-D Tensor of shape `[batch, height, width, channels]` or 3-D Tensor
        of shape `[height, width, channels]`.
      target_height: Target height.
      target_width: Target width.
      method: Method to use for resizing image. See `image.resize()`
      antialias: Whether to use anti-aliasing when resizing. See 'image.resize()'.
  
    Raises:
      ValueError: if `target_height` or `target_width` are zero or negative.
  
    Returns:
      Resized and padded image.
      If `images` was 4-D, a 4-D float Tensor of shape
      `[batch, new_height, new_width, channels]`.
      If `images` was 3-D, a 3-D float Tensor of shape
      `[new_height, new_width, channels]`.
docstring_summary: Resizes and pads an image to a target width and height.
docstring_tokens: Resizes and pads an image to a target width and height .
function: def resize_image_with_pad_v2(image,
                               target_height,
                               target_width,
                               method=ResizeMethod.BILINEAR,
                               antialias=False):
    """Resizes and pads an image to a target width and height.
  
    Resizes an image to a target width and height by keeping
    the aspect ratio the same without distortion. If the target
    dimensions don't match the image dimensions, the image
    is resized and then padded with zeroes to match requested
    dimensions.
  
    Args:
      image: 4-D Tensor of shape `[batch, height, width, channels]` or 3-D Tensor
        of shape `[height, width, channels]`.
      target_height: Target height.
      target_width: Target width.
      method: Method to use for resizing image. See `image.resize()`
      antialias: Whether to use anti-aliasing when resizing. See 'image.resize()'.
  
    Raises:
      ValueError: if `target_height` or `target_width` are zero or negative.
  
    Returns:
      Resized and padded image.
      If `images` was 4-D, a 4-D float Tensor of shape
      `[batch, new_height, new_width, channels]`.
      If `images` was 3-D, a 3-D float Tensor of shape
      `[new_height, new_width, channels]`.
    """
  
    def _resize_fn(im, new_size):
      return resize_images_v2(im, new_size, method, antialias=antialias)
  
    return _resize_image_with_pad_common(image, target_height, target_width,
                                         _resize_fn)
function_tokens: def resize_image_with_pad_v2 ( image , target_height , target_width , method = ResizeMethod . BILINEAR , antialias = False ) : def _resize_fn ( im , new_size ) : return resize_images_v2 ( im , new_size , method , antialias = antialias ) return _resize_image_with_pad_common ( image , target_height , target_width , _resize_fn )