code: def augment_img_tensor(img, mode=0):
      """Kai Zhang (github: https://github.com/cszn)"""
      img_size = img.size()
      img_np = img.data.cpu().numpy()
      if len(img_size) == 3:
          img_np = np.transpose(img_np, (1, 2, 0))
      elif len(img_size) == 4:
          img_np = np.transpose(img_np, (2, 3, 1, 0))
      img_np = augment_img(img_np, mode=mode)
      img_tensor = torch.from_numpy(np.ascontiguousarray(img_np))
      if len(img_size) == 3:
          img_tensor = img_tensor.permute(2, 0, 1)
      elif len(img_size) == 4:
          img_tensor = img_tensor.permute(3, 2, 0, 1)
  
      return img_tensor.type_as(img)
  
imports: import os
  import math
  import random
  import numpy
  import torch
  import cv2
  from torchvision.utils import make_grid
  from datetime import datetime
label_desc: Use image node_id 34 for calling a global function with example usage: augment_img_tensor(img, mode) and returns: img_tensor