code: def test_local_param_ok(backend, jit):
      data = torch.randn(10)
  
      def model():
          locs = pyro.param("locs", torch.tensor([-1.0, 0.0, 1.0]))
          with pyro.plate("plate", len(data), dim=-1):
              x = pyro.sample("x", dist.Categorical(torch.ones(3) / 3))
              pyro.sample("obs", dist.Normal(locs[x], 1.0), obs=data)
  
      def guide():
          with pyro.plate("plate", len(data), dim=-1):
              p = pyro.param(
                  "p", torch.ones(len(data), 3) / 3, event_dim=1
              )
              pyro.sample("x", dist.Categorical(p))
          return p
  
      with pyro_backend(backend):
          Elbo = infer.JitTrace_ELBO if jit else infer.Trace_ELBO
          elbo = Elbo(ignore_jit_warnings=True)
          assert_ok(model, guide, elbo)
  
          # Check that pyro.param() can be called without init_value.
          expected = guide()
          actual = pyro.param("p")
          assert ops.allclose(actual, expected)
  
imports: import warnings
  import pytest
  import funsor
  from funsor.testing import xfail_param
  from funsor.util import get_backend
label_desc: Use image node_id 14 for calling a global function with example usage: test_local_param_ok(backend, jit) and returns: p