code: def test_moduledict(self):
      class Inner(torch.nn.Module):
          def forward(self, x):
              return x + 10
  
      class Inner2(torch.nn.Module):
          def forward(self, x):
              return x * 2
  
      class Inner3(torch.nn.Module):
          def forward(self, x):
              return (x - 4) * 3
  
      class M(torch.nn.Module):
          def __init__(self):
              super().__init__()
              modules = OrderedDict(
                  [
                      ("one", Inner()),
                      ("two", Inner2()),
                      ("three", Inner3()),
                  ]
              )
              self.moduledict = nn.ModuleDict(modules)
  
          def forward(self, x, skip_name):
              # type: (Tensor, str)
              names = torch.jit.annotate(List[str], [])
              values = []
              for name in self.moduledict:
                  names.append(name)
  
              for name, mod in self.moduledict.items():
                  if name != skip_name:
                      names.append(name)
                      x = mod(x)
                      values.append(x)
  
              for mod in self.moduledict.values():
                  x = mod(x)
                  values.append(x)
  
              for key in self.moduledict.keys():
                  names.append(key)
  
              return x, names
  
      class M2(M):
          def forward(self, x, skip_name):
              # type: (Tensor, str)
              names = torch.jit.annotate(List[str], [])
              values = []
              x2 = x
              iter = 0
              for name in self.moduledict:
                  names.append(name)
  
              for i, (name, mod) in enumerate(self.moduledict.items()):
                  iter += i
                  if name != skip_name:
                      names.append(name)
                      x = mod(x)
                      values.append(x)
  
              for i, mod in enumerate(self.moduledict.values()):
                  iter += i
                  x = mod(x)
                  values.append(x)
  
              for i, key in enumerate(self.moduledict.keys()):
                  iter += i
                  names.append(key)
  
              for mod, mod in zip(
                  self.moduledict.values(), self.moduledict.values()
              ):
                  iter += i
                  x2 = mod(mod(x2))
  
              return x, x2, names, iter
  
      for name in ["", "one", "two", "three"]:
          inp = torch.tensor(1)
          self.checkModule(M(), (inp, name))
          self.checkModule(M2(), (inp, name))
  
imports: import os
  import sys
  from typing import Any, List, Tuple
  from collections import OrderedDict
  import torch
  import torch.nn
  from torch.testing._internal.jit_utils import JitTestCase
label_desc: Use image node_id 2 for calling the TestModuleContainers obj's underlying member method code with example usage: obj.test_moduledict() and returns: unknown, unknown, unknown, x,  names, x,  x2,  names,  iter