code: def test_init(shape):
      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[:-1]):
              return pyro.sample(
                  "x", dist.Normal(loc, scale).to_event(1)
              )
  
      transform = Permute(torch.randperm(shape[-1]))
      rep = UnitJacobianReparam(transform)
      check_init_reparam(model, rep)
  
file_path: pyro/tests/infer/reparam/test_unit_jacobian.py
imports: import pytest
  import torch
  from torch.autograd import grad
  import pyro
  import pyro.distributions
  from pyro import poutine
  from pyro.distributions.transforms import Permute
  from pyro.infer.reparam import UnitJacobianReparam
  from tests.common import assert_close
  from .util import check_init_reparam
label_desc: Use image node_id 3 for calling a global function with example usage: test_init(shape) and returns: pyro