code: def totensor(img):
      image = img.transpose((2, 0, 1))
      image = (
          paddle.to_tensor(image).unsqueeze(0).astype("float32") / 255.0
      )
      return image
  
file_path: PaddleHub/modules/image/Image_gan/style_transfer/paint_transformer/render_utils.py
imports: import paddle
  import paddle.nn
  import paddle.nn.functional
  import cv2
  import numpy
  from PIL import Image
  import math
label_desc: Use image node_id 4 for calling a global function with example usage: totensor(img) and returns: image