code: def test_named_children():
      a = nn.Linear(1, 1)
      b = nn.Linear(1, 1)
  
      model = nn.Sequential(OrderedDict([("a", a), ("b", b)]))
      model = Pipe(model, [1, 1], devices=["cpu", "cpu"])
  
      names = set(n for n, _ in model.named_modules())
      assert "partitions.0.a" in names
      assert "partitions.1.b" in names
  
      # Pipe doesn't support __getattr__. Unlike nn.Sequential, Pipe requires
      # several methods in its namespace.
      with pytest.raises(AttributeError):
          model.a
  
imports: from collections import OrderedDict
  from copy import deepcopy
  import time
  import pytest
  import torch
  from torch import nn
  from fairscale.nn.pipe import Pipe
label_desc: Use image node_id 29 for calling a global function with example usage: test_named_children() without return types