code: def test_enum_plate_iplate_ok():
      @infer.config_enumerate
      def model(data=None):
          probs_a = torch.tensor([0.45, 0.55])
          probs_b = torch.tensor([[0.6, 0.4], [0.4, 0.6]])
          probs_c = torch.tensor([[0.75, 0.25], [0.55, 0.45]])
          probs_d = torch.tensor(
              [[[0.4, 0.6], [0.3, 0.7]], [[0.3, 0.7], [0.2, 0.8]]]
          )
  
          b_axis = pyro.plate("b_axis", 2)
          c_axis = pyro.plate("c_axis", 2)
          a = pyro.sample("a", dist.Categorical(probs_a))
          with b_axis:
              b = pyro.sample("b", dist.Categorical(probs_b[a]))
          with b_axis:
              for j in c_axis:
                  c_j = pyro.sample(
                      "c_{}".format(j), dist.Categorical(probs_c[a])
                  )
                  pyro.sample(
                      "d_{}".format(j),
                      dist.Categorical(Vindex(probs_d)[b, c_j]),
                      obs=data[:, j],
                  )
  
      data = torch.tensor([[0, 1], [0, 0]])
      assert_ok(model, max_plate_nesting=1, data=data)
  
file_path: pyro/tests/contrib/funsor/test_valid_models_sequential_plate.py
imports: import logging
  import pytest
  import torch
  from pyro.ops.indexing import Vindex
label_desc: Use image node_id 3 for calling a global function with example usage: test_enum_plate_iplate_ok() without return types