class_docstr: A `DdpAccelerator` is a generalization of PyTorch's `DistributedDataParallel` class.
  
  This is primarly used within the :class:`allennlp.training.trainer.GradientDescentTrainer` to allow
  for different DDP implementations, such as FairScale's [`FullyShardedDataParallel`]
  (https://fairscale.readthedocs.io/en/latest/api/nn/fsdp.html).
  
  In a typical AllenNLP configuration file, `local_rank`, `world_size`, and `cuda_device`
  should not be specified.
  
  !!! Warning
      This API is experimental and may change in the future.
docstr: Wrap the AllenNLP `Model`, returning the original model (possibly on a different device)
  and the [wrapper model](#ddpwrappedmodel).
docstr_tok: ["Wrap","the","AllenNLP","`","Model","`",",","returning","the","original","model","(","possibly","on","a","different","device",")","and","the","[","wrapper","model","]","(","#","ddpwrappedmodel",")","."]
code: def wrap_model(
      self, model: "Model"
  ) -> Tuple["Model", DdpWrappedModel]:
      """
      Wrap the AllenNLP `Model`, returning the original model (possibly on a different device)
      and the [wrapper model](#ddpwrappedmodel).
      """
      raise NotImplementedError
  
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 2 for calling the DdpAccelerator obj's underlying member method code with example usage: obj.wrap_model(model) without return types