class_docstr: Implements data-parallel training in a single process, i.e., the model gets replicated to each device and each
  gets a split of the data.
class_docstr_tok: ["Implements","data-parallel","training","in","a","single","process",",","i.e.",",","the","model","gets","replicated","to","each","device","and","each","gets","a","split","of","the","data","."]
code: def __init__(
      self,
      accelerator: Optional[Accelerator] = None,
      parallel_devices: Optional[List[torch.device]] = None,
      checkpoint_io: Optional[CheckpointIO] = None,
      precision: Optional[Precision] = None,
  ):
      super().__init__(
          accelerator=accelerator,
          parallel_devices=parallel_devices,
          cluster_environment=None,
          checkpoint_io=checkpoint_io,
          precision=precision,
      )
  
imports: from typing import Any, Dict, List, Optional, Union
  import torch
  from torch import Tensor
  from torch.nn import DataParallel, Module
  from typing_extensions import override
  from lightning.fabric.accelerators import Accelerator
  from lightning.fabric.plugins.io.checkpoint_io import CheckpointIO
  from lightning.fabric.plugins.precision import Precision
  from lightning.fabric.strategies.parallel import ParallelStrategy
  from lightning.fabric.strategies.registry import _StrategyRegistry
  from lightning.fabric.strategies.strategy import TBroadcast, TReduce
  from lightning.fabric.utilities.apply_func import apply_to_collection
  from lightning.fabric.utilities.distributed import ReduceOp
label_desc: Use image node_id 1 to create a new DataParallelStrategy object from inherited base classes: ParallelStrategy with example: obj = DataParallelStrategy(accelerator, parallel_devices, checkpoint_io, precision)