code: def autocorr(X, Y):
      Xm = torch.mean(X, 1).unsqueeze(1)
      Ym = torch.mean(Y, 1).unsqueeze(1)
      r_num = torch.sum((X - Xm) * (Y - Ym), 1)
      r_den = torch.sqrt(
          torch.sum((X - Xm) ** 2, 1) * torch.sum((Y - Ym) ** 2, 1)
      )
      r_num[r_num == 0] = EPS
      r_den[r_den == 0] = EPS
      r = r_num / r_den
      r[r > 1] = 0
      r[r < -1] = 0
      return r
  
file_path: BigDL/python/chronos/example/simulator/dpgansimulator_wwt.py
imports: import sys
  import time
  import torch
  import pickle
  import numpy
  import argparse
  import matplotlib.pyplot
  from bigdl.chronos.simulator import DPGANSimulator
  from bigdl.chronos.simulator.doppelganger.output import Output, OutputType, Normalization
label_desc: Use image node_id 1 for calling a global function with example usage: autocorr(X, Y) and returns: r