class_docstr: Strategy for training with multiple processes in parallel.
class_docstr_tok: ["Strategy","for","training","with","multiple","processes","in","parallel","."]
docstr: Arguments for the ``DistributedSampler``.
  
  If this method is not defined, or it returns ``None``, then the ``DistributedSampler`` will not be used.
docstr_tok: ["Arguments","for","the","``","DistributedSampler","``",".","If","this","method","is","not","defined",",","or","it","returns","``","None","``",",","then","the","``","DistributedSampler","``","will","not","be","used","."]
code: def distributed_sampler_kwargs(self) -> Optional[Dict[str, Any]]:
      """Arguments for the ``DistributedSampler``.
  
      If this method is not defined, or it returns ``None``, then the ``DistributedSampler`` will not be used.
  
      """
      return {"num_replicas": self.world_size, "rank": self.global_rank}
  
imports: from abc import ABC
  from typing import Any, Dict, List, Optional
  import torch
  from torch import Tensor
  from typing_extensions import override
  from lightning.fabric.accelerators.accelerator import Accelerator
  from lightning.fabric.plugins.environments.cluster_environment import ClusterEnvironment
  from lightning.fabric.plugins.io.checkpoint_io import CheckpointIO
  from lightning.fabric.plugins.precision import Precision
  from lightning.fabric.strategies.strategy import Strategy
  from lightning.fabric.utilities.distributed import _all_gather_ddp_if_available
  from lightning.fabric.utilities.types import ReduceOp
label_desc: Use image node_id 9 for calling the ParallelStrategy obj's underlying member method code with example usage: obj.distributed_sampler_kwargs() and returns: dict