code: def test_plate_ok(backend, jit):
      data = torch.randn(10)
  
      def model():
          locs = pyro.param("locs", torch.tensor([0.2, 0.3, 0.5]))
          p = torch.tensor([0.2, 0.3, 0.5])
          with pyro.plate("plate", len(data), dim=-1):
              x = pyro.sample("x", dist.Categorical(p))
              pyro.sample("obs", dist.Normal(locs[x], 1.0), obs=data)
  
      def guide():
          p = pyro.param("p", torch.tensor([0.5, 0.3, 0.2]))
          with pyro.plate("plate", len(data), dim=-1):
              pyro.sample("x", dist.Categorical(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)
  
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 12 for calling a global function with example usage: test_plate_ok(backend, jit) without return types