code: def test_init(shape, dim, flip):
      loc = torch.empty(shape).uniform_(-1.0, 1.0).requires_grad_()
      scale = torch.empty(shape).uniform_(0.5, 1.5).requires_grad_()
  
      def model():
          with pyro.plate_stack("plates", shape[:dim]):
              return pyro.sample(
                  "x", dist.Normal(loc, scale).to_event(-dim)
              )
  
      check_init_reparam(model, HaarReparam(dim=dim, flip=flip))
  
file_path: pyro/tests/infer/reparam/test_haar.py
imports: import pytest
  import torch
  from torch.autograd import grad
  import pyro
  import pyro.distributions
  from pyro import poutine
  from pyro.distributions.transforms.haar import HaarTransform
  from pyro.infer.autoguide.initialization import InitMessenger, init_to_value
  from pyro.infer.reparam import HaarReparam
  from tests.common import assert_close
  from .util import check_init_reparam
label_desc: Use image node_id 4 for calling a global function with example usage: test_init(shape, dim, flip) and returns: pyro