code: def test_plate_collider():
      #   x x    y y
      #     \\  //
      #      zzzz
      #
      # This results in posterior dependency structure:
      #
      #     x x y y z z z z
      #   x ?   ? ? ? ?
      #   x   ? ? ?     ? ?
      #   y     ?   ?   ?
      #   y       ?   ?   ?
  
      def model(data):
          i_plate = pyro.plate("i", data.shape[0], dim=-2)
          j_plate = pyro.plate("j", data.shape[1], dim=-1)
  
          with i_plate:
              x = pyro.sample("x", dist.Normal(0, 1))
          with j_plate:
              y = pyro.sample("y", dist.Normal(0, 1))
          with i_plate, j_plate:
              pyro.sample("z", dist.Normal(x, y.exp()), obs=data)
  
      data = torch.randn(3, 2)
      actual = get_dependencies(model, (data,))
      _ = set()
      expected = {
          "prior_dependencies": {
              "x": {"x": _},
              "y": {"y": _},
              "z": {"x": _, "y": _, "z": _},
          },
          "posterior_dependencies": {
              "x": {"x": _, "y": _, "z": _},
              "y": {"y": _, "z": _},
          },
      }
      assert actual == expected
  
imports: import pytest
  import torch
  import pyro
  import pyro.distributions
  from pyro.distributions.testing.fakes import NonreparameterizedNormal
  from pyro.infer.inspect import _deep_merge, get_dependencies, get_model_relations
label_desc: Use image node_id 11 for calling a global function with example usage: test_plate_collider() without return types