class_docstr: Default data parallel wrapper, which applies data parallel to all unsharded modules.
class_docstr_tok: ["Default","data","parallel","wrapper",",","which","applies","data","parallel","to","all","unsharded","modules","."]
code: def wrap(
      self,
      dmp: "DistributedModelParallel",
      env: ShardingEnv,
      device: torch.device,
  ) -> None:
      if isinstance(
          dmp._dmp_wrapped_module, DistributedDataParallel
      ) or isinstance(
          dmp._dmp_wrapped_module, FullyShardedDataParallel
      ):
          return
      sharded_parameter_names = set(
          DistributedModelParallel._sharded_parameter_names(
              dmp._dmp_wrapped_module
          )
      )
      self._ddp_wrap(dmp, env, device, sharded_parameter_names)
  
imports: import abc
  import copy
  from collections import OrderedDict
  from typing import Any, cast, Dict, Iterator, List, Optional, Set, Tuple, Type
  import torch
  import torch.distributed
  from torch import nn
  from torch.distributed.algorithms.ddp_comm_hooks import default_hooks
  from torch.distributed.fsdp import FullyShardedDataParallel
  from torch.nn.modules.module import _IncompatibleKeys
  from torch.nn.parallel import DistributedDataParallel
  from torchrec.distributed.comm import get_local_size
  from torchrec.distributed.planner import EmbeddingShardingPlanner, Topology
  from torchrec.distributed.sharding_plan import get_default_sharders
  from torchrec.distributed.types import ModuleSharder, ShardedModule, ShardingEnv, ShardingPlan
  from torchrec.distributed.utils import add_prefix_to_state_dict, append_prefix, copy_to_device, filter_state_dict, sharded_model_copy
  from torchrec.optim.fused import FusedOptimizerModule
  from torchrec.optim.keyed import CombinedOptimizer, KeyedOptimizer
label_desc: Use image node_id 3 for calling the DefaultDataParallelWrapper obj's underlying member method code with example usage: obj.wrap(dmp, env, device) without return types