code: def test_generate_data_plate(backend):
      num_points = 1000
  
      def model(data=None):
          loc = pyro.param("loc", torch.tensor(2.0))
          scale = pyro.param("scale", torch.tensor(1.0))
          with pyro.plate("data", 1000, dim=-1):
              x = pyro.sample("x", dist.Normal(loc, scale), obs=data)
          return x
  
      with pyro_backend(backend):
          data = model().data
          assert data.shape == (num_points,)
          mean = data.sum().item() / num_points
          assert 1.9 <= mean <= 2.1
  
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 9 for calling a global function with example usage: test_generate_data_plate(backend) and returns: x