code: def test_rewrap_warnings():
      from torch.distributed.fsdp import FullyShardedDataParallel
      from torch.distributed.fsdp.wrap import wrap
  
      strategy = FSDPStrategy(auto_wrap_policy={torch.nn.Linear})
      fabric = Fabric(devices=1, accelerator="cuda", strategy=strategy)
      fabric.launch()
      with fabric.init_module():
          model = torch.nn.Sequential(
              torch.nn.Linear(1, 1),
              torch.nn.ReLU(),
              wrap(torch.nn.Linear(1, 1)),
          )
      with pytest.warns(match="the model is already wrapped"):
          model = fabric.setup(model)
      assert not isinstance(
          model._forward_module, FullyShardedDataParallel
      )
      assert isinstance(
          model._forward_module[2], FullyShardedDataParallel
      )
  
      if not _TORCH_GREATER_EQUAL_2_1:
          return
  
      with fabric.init_module(empty_init=True):
          model = torch.nn.Sequential(
              torch.nn.Linear(1, 1),
              torch.nn.ReLU(),
              wrap(torch.nn.Linear(1, 1)),
          )
      assert model[0].weight.is_meta
      with pytest.warns(
          match="there are still parameters on the meta device"
      ):
          fabric_model = fabric.setup(model)
      assert next(fabric_model.parameters()).is_meta
  
imports: import os
  from copy import deepcopy
  from pathlib import Path
  from unittest import mock
  import pytest
  import torch
  from lightning.fabric import Fabric
  from lightning.fabric.plugins import FSDPPrecision
  from lightning.fabric.strategies import FSDPStrategy
  from lightning.fabric.utilities.imports import _TORCH_GREATER_EQUAL_2_0, _TORCH_GREATER_EQUAL_2_1
  from lightning.fabric.wrappers import _FabricOptimizer
  from torch.distributed.fsdp import FlatParameter, FullyShardedDataParallel, OptimStateKeyType
  from torch.distributed.fsdp.wrap import always_wrap_policy, wrap
  from torch.nn import Parameter
  from tests_fabric.helpers.models import BoringFabric
  from tests_fabric.helpers.runif import RunIf
  from tests_fabric.test_fabric import BoringModel
label_desc: Use image node_id 10 for calling a global function with example usage: test_rewrap_warnings() without return types