code: def __init__(self, wrap_l2):
      super().__init__()
      self.l = nn.Linear(4, 4)
      # unused param must be wrapped, otherwise, due to flatten, it
      # is always used.
      self.not_trained = nn.Linear(4, 4).requires_grad_(False)
      self.not_trained = FullyShardedDataParallel(self.not_trained)
      # optionally testing a used param after the unused one by
      # wrapping it.
      self.l2 = nn.Linear(4, 4)
      if wrap_l2:
          # When wrapping happens, the unused param will be in the middle
          # of the param list (for optimizer state dict), not at the
          # end. This way, we can test the handling code in more corner
          # cases.
          self.l2 = FullyShardedDataParallel(self.l2)
  
imports: import copy
  import functools
  from time import time
  import unittest
  from parameterized import parameterized
  import torch
  from torch import nn
  from torch.optim import SGD, Adadelta, Adam
  from fairscale.fair_dev.testing.testing import dist_init, objects_are_equal, spawn_for_all_world_sizes
  from fairscale.internal.params import recursive_copy_to_device
  from fairscale.nn.data_parallel import FullyShardedDataParallel, get_fsdp_instances
  from fairscale.nn.data_parallel.fsdp_optim_utils import is_singleton_tensor
  from .test_fsdp import DistributedTest, DummyProcessGroup, MixtureOfExperts, TransformerWithSharedParams, rename_test, spawn_and_init
label_desc: Use image node_id 1 to create a new ModelWithUnusedParams object from inherited base classes: nn with example: obj = ModelWithUnusedParams(wrap_l2)