code: def test_elbo_enumerate_plate_6(enumerate1):
      #     Guide           Model
      #           +-------+
      #       b ----> c <---- a
      #           |  M=2  |
      #           +-------+
      # This tests that sequential enumeration over b works, even though
      # model-side enumeration moves c into b's plate via contraction.
      pyro.param(
          "model_probs_a",
          torch.tensor([0.45, 0.55]),
          constraint=constraints.simplex,
      )
      pyro.param(
          "model_probs_b",
          torch.tensor([0.6, 0.4]),
          constraint=constraints.simplex,
      )
      pyro.param(
          "model_probs_c",
          torch.tensor(
              [
                  [[0.4, 0.5, 0.1], [0.3, 0.5, 0.2]],
                  [[0.3, 0.4, 0.3], [0.4, 0.4, 0.2]],
              ]
          ),
          constraint=constraints.simplex,
      )
      pyro.param(
          "guide_probs_b",
          torch.tensor([0.8, 0.2]),
          constraint=constraints.simplex,
      )
      data = torch.tensor([1, 2])
  
      @infer.config_enumerate
      def model_plate():
          probs_a = pyro.param("model_probs_a")
          probs_b = pyro.param("model_probs_b")
          probs_c = pyro.param("model_probs_c")
          a = pyro.sample("a", dist.Categorical(probs_a))
          b = pyro.sample("b", dist.Categorical(probs_b))
          with pyro.plate("b_axis", 2):
              pyro.sample(
                  "c", dist.Categorical(Vindex(probs_c)[a, b]), obs=data
              )
  
      @infer.config_enumerate
      def model_iplate():
          probs_a = pyro.param("model_probs_a")
          probs_b = pyro.param("model_probs_b")
          probs_c = pyro.param("model_probs_c")
          a = pyro.sample("a", dist.Categorical(probs_a))
          b = pyro.sample("b", dist.Categorical(probs_b))
          for i in pyro.plate("b_axis", 2):
              pyro.sample(
                  "c_{}".format(i),
                  dist.Categorical(Vindex(probs_c)[a, b]),
                  obs=data[i],
              )
  
      @infer.config_enumerate(default=enumerate1)
      def guide():
          probs_b = pyro.param("guide_probs_b")
          pyro.sample("b", dist.Categorical(probs_b))
  
      elbo = infer.TraceEnum_ELBO(max_plate_nesting=0)
      expected_loss = elbo.differentiable_loss(model_iplate, guide)
      elbo = infer.TraceEnum_ELBO(max_plate_nesting=1)
      actual_loss = elbo.differentiable_loss(model_plate, guide)
      _check_loss_and_grads(expected_loss, actual_loss)
  
imports: import logging
  import os
  import pyroapi
  import pytest
  import torch
  from torch.autograd import grad
  from torch.distributions import constraints
  from pyro.ops.indexing import Vindex
  from pyro.util import torch_isnan
  from tests.common import assert_equal, xfail_param
label_desc: Use image node_id 11 for calling a global function with example usage: test_elbo_enumerate_plate_6(enumerate1) without return types