code: def test_nested_iplate():
      means = [torch.randn(2) for i in range(8)]
      mean_batch_size = 2
      stds = [torch.abs(torch.randn(2)) for i in range(6)]
      std_batch_size = 3
  
      def model(means, stds):
          a_plate = pyro.plate("a", len(means), mean_batch_size)
          b_plate = pyro.plate("b", len(stds), std_batch_size)
          return [
              [
                  pyro.sample(
                      "x_{}{}".format(i, j),
                      dist.Normal(means[i], stds[j]),
                  )
                  for j in b_plate
              ]
              for i in a_plate
          ]
  
      xs = model(means, stds)
      assert len(xs) == mean_batch_size
      assert len(xs[0]) == std_batch_size
  
      tr = poutine.trace(model).get_trace(means, stds)
      for name in tr.nodes.keys():
          if tr.nodes[name]["type"] == "sample" and name.startswith(
              "x_"
          ):
              assert tr.nodes[name]["scale"] == 4.0 * 2.0
  
file_path: pyro/tests/poutine/test_mapdata.py
imports: import logging
  import pytest
  import torch
  import pyro
  import pyro.distributions
  import pyro.poutine
  from tests.common import requires_cuda
label_desc: Use image node_id 1 for calling a global function with example usage: test_nested_iplate() and returns: unknown