code: def perlin(width, height, scale=10):
      gx, gy = paddle.randn([2, width + 1, height + 1, 1, 1])
      xs = paddle.linspace(0, 1, scale + 1)[:-1, None]
      ys = paddle.linspace(0, 1, scale + 1)[None, :-1]
      wx = 1 - interp(xs)
      wy = 1 - interp(ys)
      dots = 0
      dots += wx * wy * (gx[:-1, :-1] * xs + gy[:-1, :-1] * ys)
      dots += (
          (1 - wx) * wy * (-gx[1:, :-1] * (1 - xs) + gy[1:, :-1] * ys)
      )
      dots += (
          wx * (1 - wy) * (gx[:-1, 1:] * xs - gy[:-1, 1:] * (1 - ys))
      )
      dots += (
          (1 - wx)
          * (1 - wy)
          * (-gx[1:, 1:] * (1 - xs) - gy[1:, 1:] * (1 - ys))
      )
      return dots.transpose([0, 2, 1, 3]).reshape(
          [width * scale, height * scale]
      )
  
file_path: PaddleHub/modules/image/text_to_image/disco_diffusion_clip_vitb32/reverse_diffusion/model/perlin_noises.py
imports: import numpy
  import paddle
  import paddle.vision.transforms
  from PIL import Image
  from PIL import ImageOps
label_desc: Use image node_id 2 for calling a global function with example usage: perlin(width, height, scale) and returns: dots