code: def compute_mean_covariance(img):
      batch_size = img.shape[0]
      channel_num = img.shape[1]
      height = img.shape[2]
      width = img.shape[3]
      num_pixels = height * width
  
      # batch_size * channel_num * 1 * 1
      mu = img.mean(2, keepdim=True).mean(3, keepdim=True)
  
      # batch_size * channel_num * num_pixels
      img_hat = img - mu.expand_as(img)
      img_hat = img_hat.reshape([batch_size, channel_num, num_pixels])
      # batch_size * num_pixels * channel_num
      img_hat_transpose = img_hat.transpose([0, 2, 1])
      # batch_size * channel_num * channel_num
      covariance = paddle.bmm(img_hat, img_hat_transpose)
      covariance = covariance / num_pixels
  
      return mu, covariance
  
label_desc: Use image node_id 1 for calling a global function with example usage: compute_mean_covariance(img) and returns: mu,  covariance