parameters: (images,
                       size,
                       method=ResizeMethod.BILINEAR,
                       preserve_aspect_ratio=False,
                       antialias=False,
                       name=None)
return_statement: return _resize_images_common(
        images,
        resize_fn,
        size,
        preserve_aspect_ratio=preserve_aspect_ratio,
        name=name,
        skip_resize_if_same=False)
docstring: Resize `images` to `size` using the specified `method`.
  
    Resized images will be distorted if their original aspect ratio is not
    the same as `size`.  To avoid distortions see
    `tf.image.resize_with_pad`.
  
    When 'antialias' is true, the sampling filter will anti-alias the input image
    as well as interpolate.  When downsampling an image with [anti-aliasing](
    https://en.wikipedia.org/wiki/Spatial_anti-aliasing) the sampling filter
    kernel is scaled in order to properly anti-alias the input image signal.
    'antialias' has no effect when upsampling an image.
  
    *   <b>`bilinear`</b>: [Bilinear interpolation.](
      https://en.wikipedia.org/wiki/Bilinear_interpolation) If 'antialias' is
      true, becomes a hat/tent filter function with radius 1 when downsampling.
    *   <b>`lanczos3`</b>:  [Lanczos kernel](
      https://en.wikipedia.org/wiki/Lanczos_resampling) with radius 3.
      High-quality practical filter but may have some ringing especially on
      synthetic images.
    *   <b>`lanczos5`</b>: [Lanczos kernel] (
      https://en.wikipedia.org/wiki/Lanczos_resampling) with radius 5.
      Very-high-quality filter but may have stronger ringing.
    *   <b>`bicubic`</b>: [Cubic interpolant](
      https://en.wikipedia.org/wiki/Bicubic_interpolation) of Keys. Equivalent to
      Catmull-Rom kernel. Reasonably good quality and faster than Lanczos3Kernel,
      particularly when upsampling.
    *   <b>`gaussian`</b>: [Gaussian kernel](
      https://en.wikipedia.org/wiki/Gaussian_filter) with radius 3,
      sigma = 1.5 / 3.0.
    *   <b>`nearest`</b>: [Nearest neighbor interpolation.](
      https://en.wikipedia.org/wiki/Nearest-neighbor_interpolation)
      'antialias' has no effect when used with nearest neighbor interpolation.
    *   <b>`area`</b>: Anti-aliased resampling with area interpolation.
      'antialias' has no effect when used with area interpolation; it
      always anti-aliases.
    *   <b>`mitchellcubic`</b>: Mitchell-Netravali Cubic non-interpolating filter.
      For synthetic images (especially those lacking proper prefiltering), less
      ringing than Keys cubic kernel but less sharp.
  
    Note that near image edges the filtering kernel may be partially outside the
    image boundaries. For these pixels, only input pixels inside the image will be
    included in the filter sum, and the output value will be appropriately
    normalized.
  
    The return value has the same type as `images` if `method` is
    `ResizeMethod.NEAREST_NEIGHBOR`. Otherwise, the return value has type
    `float32`.
  
    Args:
      images: 4-D Tensor of shape `[batch, height, width, channels]` or 3-D Tensor
        of shape `[height, width, channels]`.
      size: A 1-D int32 Tensor of 2 elements: `new_height, new_width`.  The new
        size for the images.
      method: ResizeMethod.  Defaults to `bilinear`.
      preserve_aspect_ratio: Whether to preserve the aspect ratio. If this is set,
        then `images` will be resized to a size that fits in `size` while
        preserving the aspect ratio of the original image. Scales up the image if
        `size` is bigger than the current size of the `image`. Defaults to False.
      antialias: Whether to use an anti-aliasing filter when downsampling an
        image.
      name: A name for this operation (optional).
  
    Raises:
      ValueError: if the shape of `images` is incompatible with the
        shape arguments to this function
      ValueError: if `size` has invalid shape or type.
      ValueError: if an unsupported resize method is specified.
  
    Returns:
      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: Resize `images` to `size` using the specified `method`.
docstring_tokens: Resize images to size using the specified method .
function: def resize_images_v2(images,
                       size,
                       method=ResizeMethod.BILINEAR,
                       preserve_aspect_ratio=False,
                       antialias=False,
                       name=None):
    """Resize `images` to `size` using the specified `method`.
  
    Resized images will be distorted if their original aspect ratio is not
    the same as `size`.  To avoid distortions see
    `tf.image.resize_with_pad`.
  
    When 'antialias' is true, the sampling filter will anti-alias the input image
    as well as interpolate.  When downsampling an image with [anti-aliasing](
    https://en.wikipedia.org/wiki/Spatial_anti-aliasing) the sampling filter
    kernel is scaled in order to properly anti-alias the input image signal.
    'antialias' has no effect when upsampling an image.
  
    *   <b>`bilinear`</b>: [Bilinear interpolation.](
      https://en.wikipedia.org/wiki/Bilinear_interpolation) If 'antialias' is
      true, becomes a hat/tent filter function with radius 1 when downsampling.
    *   <b>`lanczos3`</b>:  [Lanczos kernel](
      https://en.wikipedia.org/wiki/Lanczos_resampling) with radius 3.
      High-quality practical filter but may have some ringing especially on
      synthetic images.
    *   <b>`lanczos5`</b>: [Lanczos kernel] (
      https://en.wikipedia.org/wiki/Lanczos_resampling) with radius 5.
      Very-high-quality filter but may have stronger ringing.
    *   <b>`bicubic`</b>: [Cubic interpolant](
      https://en.wikipedia.org/wiki/Bicubic_interpolation) of Keys. Equivalent to
      Catmull-Rom kernel. Reasonably good quality and faster than Lanczos3Kernel,
      particularly when upsampling.
    *   <b>`gaussian`</b>: [Gaussian kernel](
      https://en.wikipedia.org/wiki/Gaussian_filter) with radius 3,
      sigma = 1.5 / 3.0.
    *   <b>`nearest`</b>: [Nearest neighbor interpolation.](
      https://en.wikipedia.org/wiki/Nearest-neighbor_interpolation)
      'antialias' has no effect when used with nearest neighbor interpolation.
    *   <b>`area`</b>: Anti-aliased resampling with area interpolation.
      'antialias' has no effect when used with area interpolation; it
      always anti-aliases.
    *   <b>`mitchellcubic`</b>: Mitchell-Netravali Cubic non-interpolating filter.
      For synthetic images (especially those lacking proper prefiltering), less
      ringing than Keys cubic kernel but less sharp.
  
    Note that near image edges the filtering kernel may be partially outside the
    image boundaries. For these pixels, only input pixels inside the image will be
    included in the filter sum, and the output value will be appropriately
    normalized.
  
    The return value has the same type as `images` if `method` is
    `ResizeMethod.NEAREST_NEIGHBOR`. Otherwise, the return value has type
    `float32`.
  
    Args:
      images: 4-D Tensor of shape `[batch, height, width, channels]` or 3-D Tensor
        of shape `[height, width, channels]`.
      size: A 1-D int32 Tensor of 2 elements: `new_height, new_width`.  The new
        size for the images.
      method: ResizeMethod.  Defaults to `bilinear`.
      preserve_aspect_ratio: Whether to preserve the aspect ratio. If this is set,
        then `images` will be resized to a size that fits in `size` while
        preserving the aspect ratio of the original image. Scales up the image if
        `size` is bigger than the current size of the `image`. Defaults to False.
      antialias: Whether to use an anti-aliasing filter when downsampling an
        image.
      name: A name for this operation (optional).
  
    Raises:
      ValueError: if the shape of `images` is incompatible with the
        shape arguments to this function
      ValueError: if `size` has invalid shape or type.
      ValueError: if an unsupported resize method is specified.
  
    Returns:
      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(images_t, new_size):
      """Resize core function, passed to _resize_images_common."""
      scale_and_translate_methods = [
          ResizeMethod.LANCZOS3, ResizeMethod.LANCZOS5, ResizeMethod.GAUSSIAN,
          ResizeMethod.MITCHELLCUBIC
      ]
  
      def resize_with_scale_and_translate(method):
        scale = (
            math_ops.cast(new_size, dtype=dtypes.float32) /
            math_ops.cast(array_ops.shape(images_t)[1:3], dtype=dtypes.float32))
        return gen_image_ops.scale_and_translate(
            images_t,
            new_size,
            scale,
            array_ops.zeros([2]),
            kernel_type=method,
            antialias=antialias)
  
      if method == ResizeMethod.BILINEAR:
        if antialias:
          return resize_with_scale_and_translate('triangle')
        else:
          return gen_image_ops.resize_bilinear(
              images_t, new_size, half_pixel_centers=True)
      elif method == ResizeMethod.NEAREST_NEIGHBOR:
        return gen_image_ops.resize_nearest_neighbor(
            images_t, new_size, half_pixel_centers=True)
      elif method == ResizeMethod.BICUBIC:
        if antialias:
          return resize_with_scale_and_translate('keyscubic')
        else:
          return gen_image_ops.resize_bicubic(
              images_t, new_size, half_pixel_centers=True)
      elif method == ResizeMethod.AREA:
        return gen_image_ops.resize_area(images_t, new_size)
      elif method in scale_and_translate_methods:
        return resize_with_scale_and_translate(method)
      else:
        raise ValueError('Resize method is not implemented.')
  
    return _resize_images_common(
        images,
        resize_fn,
        size,
        preserve_aspect_ratio=preserve_aspect_ratio,
        name=name,
        skip_resize_if_same=False)
function_tokens: def resize_images_v2 ( images , size , method = ResizeMethod . BILINEAR , preserve_aspect_ratio = False , antialias = False , name = None ) : def resize_fn ( images_t , new_size ) : """Resize core function, passed to _resize_images_common.""" scale_and_translate_methods = [ ResizeMethod . LANCZOS3 , ResizeMethod . LANCZOS5 , ResizeMethod . GAUSSIAN , ResizeMethod . MITCHELLCUBIC ] def resize_with_scale_and_translate ( method ) : scale = ( math_ops . cast ( new_size , dtype = dtypes . float32 ) / math_ops . cast ( array_ops . shape ( images_t ) [ 1 : 3 ] , dtype = dtypes . float32 ) ) return gen_image_ops . scale_and_translate ( images_t , new_size , scale , array_ops . zeros ( [ 2 ] ) , kernel_type = method , antialias = antialias ) if method == ResizeMethod . BILINEAR : if antialias : return resize_with_scale_and_translate ( 'triangle' ) else : return gen_image_ops . resize_bilinear ( images_t , new_size , half_pixel_centers = True ) elif method == ResizeMethod . NEAREST_NEIGHBOR : return gen_image_ops . resize_nearest_neighbor ( images_t , new_size , half_pixel_centers = True ) elif method == ResizeMethod . BICUBIC : if antialias : return resize_with_scale_and_translate ( 'keyscubic' ) else : return gen_image_ops . resize_bicubic ( images_t , new_size , half_pixel_centers = True ) elif method == ResizeMethod . AREA : return gen_image_ops . resize_area ( images_t , new_size ) elif method in scale_and_translate_methods : return resize_with_scale_and_translate ( method ) else : raise ValueError ( 'Resize method is not implemented.' ) return _resize_images_common ( images , resize_fn , size , preserve_aspect_ratio = preserve_aspect_ratio , name = name , skip_resize_if_same = False )