code: def test_nested_plate_collider():
      # a a       b b
      #  a a     b b
      #    \\   //
      #      c c
      #       |
      #       d
  
      def model():
          plate_i = pyro.plate("i", 2, dim=-1)
          plate_j = pyro.plate("j", 3, dim=-2)
          plate_k = pyro.plate("k", 3, dim=-2)
  
          with plate_i:
              with plate_j:
                  a = pyro.sample("a", dist.Normal(0, 1))
              with plate_k:
                  b = pyro.sample("b", dist.Normal(0, 1))
              c = pyro.sample(
                  "c", dist.Normal(a.sum(0) + b.sum([0, 1]), 1)
              )
          pyro.sample("d", dist.Normal(c.sum(), 1), obs=torch.zeros(()))
  
      actual = get_dependencies(model)
      _ = set()
      expected = {
          "prior_dependencies": {
              "a": {"a": _},
              "b": {"b": _},
              "c": {"c": _, "a": _, "b": _},
              "d": {"d": _, "c": _},
          },
          "posterior_dependencies": {
              "a": {"a": {"j"}, "b": _, "c": _},
              "b": {"b": {"k"}, "c": _},
              "c": {"c": {"i"}, "d": _},
          },
      }
      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 13 for calling a global function with example usage: test_nested_plate_collider() without return types