code: def test_devices():
      a = nn.Linear(1, 1)
      b = nn.Linear(1, 1)
      c = nn.Linear(1, 1)
  
      # There are extra two devices.
      devices = ["cpu", "cpu", "cpu", "cpu", "cpu"]
  
      model = nn.Sequential(a, b, c)
      model = Pipe(model, [1, 1, 1], devices=devices)
  
      cpu = torch.device("cpu")
      # Extra devices must be discarded.
      assert model.devices == [cpu, cpu, cpu]
  
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 25 for calling a global function with example usage: test_devices() without return types