class_docstr: The type of the wrapped model returned from [`DdpAccelerator.wrap_model`](#wrap_model).
code: def __init__(
      self,
      model: torch.nn.Module,
      local_rank: Optional[int] = None,
      world_size: Optional[int] = None,
  ) -> None:
      self.model = model
      self.local_rank: int = (
          local_rank if local_rank is not None else dist.get_rank()
      )
      self.world_size: int = (
          world_size
          if world_size is not None
          else dist.get_world_size()
      )
      self.is_primary: bool = self.local_rank == 0
  
imports: import os
  from typing import Union, Tuple, OrderedDict, Dict, NamedTuple, List, Optional, Any, Sequence, TYPE_CHECKING
  import torch
  import torch.distributed
  from torch.cuda import amp
  from torch.nn.utils import clip_grad_norm_
  from allennlp.common import Registrable
  from allennlp.common.util import int_to_device
  from allennlp.nn.parallel.sharded_module_mixin import ShardedModuleMixin
label_desc: Use image node_id 1 to create a new DdpWrappedModel object  with example: obj = DdpWrappedModel(model, local_rank, world_size)