code: def layerwise_sandbox(
      module: nn.Sequential,
      device: torch.device,
  ) -> Generator[nn.Module, None, None]:
      """Copies layers for ease to profile. It doesn't modify the given
      module.
      """
      for layer in module:
          layer_copy = copy.deepcopy(layer)
          layer_copy.to(device)
          layer_copy.train()
          yield layer_copy
  
file_path: fairscale/fairscale/nn/pipe/balance/profile.py
imports: import copy
  import time
  from typing import Generator, List, Tuple, Union
  import torch
  from torch import Tensor
  import torch.nn
  from ..microbatch import Batch
label_desc: Use image node_id 1 for calling a global function with example usage: layerwise_sandbox(module, device) without return types