code: def get_moments(x):
      n = x.size(0)
      x = x.reshape(n, -1)
      mean = x.mean(0)
      x = x - mean
      std = (x * x).mean(0).sqrt()
      x = x / std
      corr = (x.unsqueeze(-1) * x.unsqueeze(-2)).mean(0).reshape(-1)
      return torch.cat([mean, std, corr])
  
file_path: pyro/tests/infer/reparam/test_discrete_cosine.py
imports: import pytest
  import torch
  from torch.autograd import grad
  import pyro
  import pyro.distributions
  from pyro import poutine
  from pyro.infer.reparam import DiscreteCosineReparam
  from tests.common import assert_close
  from .util import check_init_reparam
label_desc: Use image node_id 1 for calling a global function with example usage: get_moments(x) and returns: torch