code: def test_plate_coupling_3():
      #    x x x x
      #     // \\
      #   y y   z z
      #
      # This results in posterior dependency structure:
      #
      #     x x y y 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, j_plate:
              x = pyro.sample("x", dist.Normal(0, 1))
          with i_plate:
              pyro.sample(
                  "y",
                  dist.Normal(x.sum(-1, True), 1),
                  obs=data.sum(-1, True),
              )
          with j_plate:
              pyro.sample(
                  "z",
                  dist.Normal(x.sum(-2, True), 1),
                  obs=data.sum(-2, True),
              )
  
      data = torch.randn(3, 2)
      actual = get_dependencies(model, (data,))
      expected = {
          "prior_dependencies": {
              "x": {"x": set()},
              "y": {"y": set(), "x": set()},
              "z": {"z": set(), "x": set()},
          },
          "posterior_dependencies": {
              "x": {"x": {"i", "j"}, "y": set(), "z": set()},
          },
      }
      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 10 for calling a global function with example usage: test_plate_coupling_3() without return types