code: def test_plate_smoke(infer, temperature, plate_size):
      #       +-----------------+
      #  z1 --|--> z2 ---> x2   |
      #       |               N | for N in {1,2}
      #       +-----------------+
  
      @config_enumerate
      def model():
          p = pyro.param("p", torch.tensor([0.25, 0.75]))
          q = pyro.param(
              "q", torch.tensor([[0.25, 0.75], [0.75, 0.25]])
          )
          loc = pyro.param("loc", torch.tensor([-1.0, 1.0]))
          z1 = pyro.sample("z1", dist.Categorical(p))
          with pyro.plate("plate", plate_size):
              z2 = pyro.sample("z2", dist.Categorical(q[z1]))
              pyro.sample(
                  "x2",
                  dist.Normal(loc[z2], 1.0),
                  obs=torch.ones(plate_size),
              )
  
      first_available_dim = -2
      infer(model, first_available_dim, temperature)()
  
imports: import logging
  import math
  import warnings
  import pytest
  import torch
  from torch.autograd import grad
  import pyro
  import pyro.distributions
  from pyro import poutine
  from pyro.infer import TraceEnum_ELBO
  from pyro.infer.discrete import TraceEnumSample_ELBO, infer_discrete
  from pyro.infer.enum import config_enumerate
  from tests.common import assert_equal
label_desc: Use image node_id 3 for calling a global function with example usage: test_plate_smoke(infer, temperature, plate_size) without return types