code: def forward(self, img):
      if isinstance(img, torch.Tensor):
          height, width = img.shape[:2]
      else:
          width, height = img.size
      scale = self.max_size / float(max(height, width))
      if scale != 1.0:
          assert (
              TORCHVISION_AVAILABLE
          ), "Torchvision imports failed but they are required."
          new_size = tuple(
              round(dim * scale) for dim in (height, width)
          )
          img = F.resize(img, new_size, self.interpolation)
          pad_h = self.max_size - new_size[0]
          pad_w = self.max_size - new_size[1]
          img = F.pad(
              img,
              padding=[
                  pad_w // 2,
                  pad_h // 2,
                  pad_w - pad_w // 2,
                  pad_h - pad_h // 2,
              ],
              fill=self.fill,
          )
      return img
  
file_path: NeMo/nemo/collections/multimodal/data/clip/augmentations/augmentations.py
imports: from typing import Optional, Tuple
  import torch
  import torch.nn
label_desc: Use image node_id 2 for calling the ResizeMaxSize obj's underlying member method code with example usage: obj.forward(img) and returns: img