function resizeNearestNeighbor_(images, size, alignCorners, halfPixelCenters) {
	  if (alignCorners === void 0) {
	    alignCorners = false;
	  }

	  if (halfPixelCenters === void 0) {
	    halfPixelCenters = false;
	  }

	  var $images = convertToTensor(images, 'images', 'resizeNearestNeighbor');
	  assert($images.rank === 3 || $images.rank === 4, function () {
	    return "Error in resizeNearestNeighbor: x must be rank 3 or 4, but got " + ("rank " + $images.rank + ".");
	  });
	  assert(size.length === 2, function () {
	    return "Error in resizeNearestNeighbor: new shape must 2D, but got shape " + (size + ".");
	  });
	  assert($images.dtype === 'float32' || $images.dtype === 'int32', function () {
	    return '`images` must have `int32` or `float32` as dtype';
	  });
	  assert(halfPixelCenters === false || alignCorners === false, function () {
	    return "Error in resizeNearestNeighbor: If halfPixelCenters is true, " + "alignCorners must be false.";
	  });
	  var batchImages = $images;
	  var reshapedTo4D = false;

	  if ($images.rank === 3) {
	    reshapedTo4D = true;
	    batchImages = reshape($images, [1, $images.shape[0], $images.shape[1], $images.shape[2]]);
	  }

	  var inputs = {
	    images: batchImages
	  };
	  var attrs = {
	    alignCorners: alignCorners,
	    halfPixelCenters: halfPixelCenters,
	    size: size
	  }; // tslint:disable-next-line: no-unnecessary-type-assertion

	  var res = ENGINE.runKernel(ResizeNearestNeighbor, inputs, attrs);

	  if (reshapedTo4D) {
	    return reshape(res, [res.shape[1], res.shape[2], res.shape[3]]);
	  }

	  return res;
	}
NearestNeighbor resize a batch of 3D images to a new shape.

@param images The images, of rank 4 or rank 3, of shape
    `[batch, height, width, inChannels]`. If rank 3, batch of 1 is assumed.
@param size The new shape `[newHeight, newWidth]` to resize the
    images to. Each channel is resized individually.
@param alignCorners Defaults to False. If true, rescale
    input by `(new_height - 1) / (height - 1)`, which exactly aligns the 4
    corners of images and resized images. If false, rescale by
    `new_height / height`. Treat similarly the width dimension.
@param halfPixelCenters Defaults to `false`. Whether to assumes pixels are of
     half the actual dimensions, and yields more accurate resizes. This flag
     would also make the floating point coordinates of the top left pixel
     0.5, 0.5.

@doc {heading: 'Operations', subheading: 'Images', namespace: 'image'}