class_docstr: Resizes image to a given size, adding padding to perserve the aspect ratio.
  
  Padding is added on the bottom and right.
  
  Attr:
    size: The new size of the image: either an integer H, where H is both the
      new height and width, or a tuple or list [H, W] of integers, where H and W
      are new image's height and width respectively.
    pad_value: Value to use for padding.
    antialias: Whether to use an anti-aliasing filter when downsampling an
      image.
class_docstr_tok: ["Resizes","image","to","a","given","size",",","adding","padding","to","perserve","the","aspect","ratio",".","Padding","is","added","on","the","bottom","and","right",".","Attr",":","size",":","The","new","size","of","the","image",":","either","an","integer","H",",","where","H","is","both","the","new","height","and","width",",","or","a","tuple","or","list","[","H",",","W","]","of","integers",",","where","H","and","W","are","new","image","'s","height","and","width","respectively",".","pad_value",":","Value","to","use","for","padding",".","antialias",":","Whether","to","use","an","anti-aliasing","filter","when","downsampling","an","image","."]
code: def apply(self, image: tf.Tensor) -> tf.Tensor:
      return self._resize_image(image, pad_value=self.pad_value)
  
imports: import abc
  import dataclasses
  from typing import Optional, Sequence, Tuple, Union
  from clu import preprocess_spec
  from scenic.projects.owl_vit.preprocessing import modalities
  from scenic.projects.owl_vit.preprocessing import transforms
  import tensorflow
label_desc: Use image node_id 2 for calling the ResizeWithPad obj's underlying member method code with example usage: obj.apply(image) and returns: self