code: def test_fsdp_cpu_offload():
      """Test the different ways cpu offloading can be enabled."""
      # bool
      strategy = FSDPStrategy(cpu_offload=True)
      assert strategy.cpu_offload == CPUOffload(offload_params=True)
  
      # dataclass
      config = CPUOffload()
      strategy = FSDPStrategy(cpu_offload=config)
      assert strategy.cpu_offload == config
  
imports: from datetime import timedelta
  from re import escape
  from unittest import mock
  from unittest.mock import ANY, MagicMock, Mock
  import lightning.fabric
  import pytest
  import torch
  import torch.nn
  from lightning.fabric.plugins import HalfPrecision
  from lightning.fabric.plugins.environments import LightningEnvironment
  from lightning.fabric.strategies import FSDPStrategy
  from lightning.fabric.strategies.fsdp import _FSDPBackwardSyncControl, _get_full_state_dict_context, _has_meta_device_parameters, _is_sharded_checkpoint
  from lightning.fabric.utilities.imports import _TORCH_GREATER_EQUAL_2_1
  from torch.distributed.fsdp.fully_sharded_data_parallel import CPUOffload, FullyShardedDataParallel, MixedPrecision
  from torch.optim import Adam
  from tests_fabric.helpers.runif import RunIf
label_desc: Use image node_id 2 for calling a global function with example usage: test_fsdp_cpu_offload() without return types