code: def test_init(batch_shape, event_shape, splits, dim):
      shape = batch_shape + event_shape
      loc = torch.empty(shape).uniform_(-1.0, 1.0)
      scale = torch.empty(shape).uniform_(0.5, 1.5)
  
      def model():
          with pyro.plate_stack("plates", batch_shape):
              return pyro.sample(
                  "x",
                  dist.Normal(loc, scale).to_event(len(event_shape)),
              )
  
      check_init_reparam(model, SplitReparam(splits, dim))
  
file_path: pyro/tests/infer/reparam/test_split.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 SplitReparam
  from tests.common import assert_close
  from .util import check_init_reparam
label_desc: Use image node_id 2 for calling a global function with example usage: test_init(batch_shape, event_shape, splits, dim) and returns: pyro