code: def get_hmm_moments(samples):
      loc = samples.median(0).values
      delta = samples - loc
      cov = (delta.unsqueeze(-1) * delta.unsqueeze(-2)).sqrt().mean(0)
      scale = cov.diagonal(dim1=-2, dim2=-1)
      sigma = scale.sqrt()
      corr = cov / (sigma.unsqueeze(-1) * sigma.unsqueeze(-2))
      return loc, scale, corr
  
file_path: pyro/tests/infer/reparam/test_hmm.py
imports: import pytest
  import torch
  import pyro
  import pyro.distributions
  from pyro import poutine
  from pyro.infer.reparam import LinearHMMReparam, StableReparam, StudentTReparam, SymmetricStableReparam
  from tests.common import assert_close
  from tests.ops.gaussian import random_mvn
  from .util import check_init_reparam
label_desc: Use image node_id 7 for calling a global function with example usage: get_hmm_moments(samples) and returns: loc,  scale,  corr