code: def test_nested():
      class Child(PyroModule):
          def __init__(self, a):
              super().__init__()
              self.a = PyroParam(a, constraints.positive)
  
      class Family(PyroModule):
          def __init__(self):
              super().__init__()
              self.child1 = Child(torch.tensor(1.0))
              self.child2 = Child(torch.tensor(2.0))
  
      f = Family()
      assert_equal(f.child1.a.detach(), torch.tensor(1.0))
      assert_equal(f.child2.a.detach(), torch.tensor(2.0))
  
imports: import io
  import warnings
  import pytest
  import torch
  from torch import nn
  from torch.distributions import constraints, transform_to
  import pyro
  import pyro.distributions
  from pyro import poutine
  from pyro.infer import SVI, Trace_ELBO
  from pyro.nn.module import PyroModule, PyroParam, PyroSample, clear, to_pyro_module_
  from pyro.optim import Adam
  from tests.common import assert_equal
label_desc: Use image node_id 6 for calling a global function with example usage: test_nested() without return types