class_docstr: Strategy that handles communication on a single device.
class_docstr_tok: ["Strategy","that","handles","communication","on","a","single","device","."]
code: def __init__(
      self,
      device: _DEVICE = "cpu",
      accelerator: Accelerator | None = None,
      checkpoint_io: CheckpointIO | None = None,
      precision: Precision | None = None,
  ):
      super().__init__(
          accelerator=accelerator,
          checkpoint_io=checkpoint_io,
          precision=precision,
      )
      if not isinstance(device, torch.device):
          device = torch.device(device)
      self._root_device = device
      self.global_rank = 0
      self.local_rank = 0
      self.world_size = 1
  
imports: from __future__ import annotations
  from typing import Any
  import torch
  from torch.nn import 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.strategy import Strategy, TBroadcast
  from lightning.fabric.utilities.types import _DEVICE
label_desc: Use image node_id 1 to create a new SingleDeviceStrategy object from inherited base classes: Strategy with example: obj = SingleDeviceStrategy(device, accelerator, checkpoint_io, precision)