docstr: Tests that ``apply()`` modifies parameter values in-place on an
  FSDP-wrapped transformer model with shared parameters.
docstr_tok: ["Tests","that","``","apply","(",")","``","modifies","parameter","values","in-place","on","an","FSDP-wrapped","transformer","model","with","shared","parameters","."]
code: def test_transformer_module_apply(self):
      """Tests that ``apply()`` modifies parameter values in-place on an
      FSDP-wrapped transformer model with shared parameters."""
      transformer = TransformerWithSharedParams.init(
          self.process_group,
          FSDPInitMode.RECURSIVE,
          CUDAInitMode.CUDA_AFTER,
      )
      self._check_apply(transformer)
  
file_path: pytorch/test/distributed/fsdp/test_fsdp_apply.py
imports: import sys
  import torch
  import torch.distributed
  import torch.nn
  from torch.distributed.fsdp import FullyShardedDataParallel
  from torch.testing._internal.common_distributed import skip_if_lt_x_gpu
  from torch.testing._internal.common_fsdp import CUDAInitMode, FSDPInitMode, FSDPTest, NestedWrappedModule, TransformerWithSharedParams
  from torch.testing._internal.common_utils import run_tests, TEST_WITH_DEV_DBG_ASAN
label_desc: Use image node_id 6 for calling the TestApply obj's underlying member method code with example usage: obj.test_transformer_module_apply() without return types