class_docstr: Crop and/or pad image with random placement within the crop or pad margin.
      
class_docstr_tok: ["Crop","and\/or","pad","image","with","random","placement","within","the","crop","or","pad","margin","."]
code: def get_params(img, size):
      _, image_height, image_width = F.get_dimensions(img)
      delta_height = image_height - size[0]
      delta_width = image_width - size[1]
      top = int(
          math.copysign(
              random.randint(0, abs(delta_height)), delta_height
          )
      )
      left = int(
          math.copysign(
              random.randint(0, abs(delta_width)), delta_width
          )
      )
      return top, left
  
imports: import math
  import numbers
  import random
  import warnings
  from typing import List, Sequence, Tuple, Union
  import torch
  import torchvision.transforms.functional
  from PIL import Image
  import numpy
label_desc: Use image node_id 2 for calling the RandomCropOrPad obj's underlying member method code with example usage: obj.get_params(img, size) and returns: top,  left