class_docstr: Strategy that handles communication on a single device.
class_docstr_tok: ["Strategy","that","handles","communication","on","a","single","device","."]
docstr: Reduces a tensor from several distributed processes to one aggregated tensor. As this plugin only operates
  with a single device, the reduction is simply the identity.
  
  Args:
      tensor: the tensor to sync and reduce
      *args: ignored
      **kwargs: ignored
  
  Return:
      the unmodified input as reduction is not needed for single process operation
docstr_tok: ["Reduces","a","tensor","from","several","distributed","processes","to","one","aggregated","tensor",".","As","this","plugin","only","operates","with","a","single","device",",","the","reduction","is","simply","the","identity",".","Args",":","tensor",":","the","tensor","to","sync","and","reduce","*","args",":","ignored","*","*","kwargs",":","ignored","Return",":","the","unmodified","input","as","reduction","is","not","needed","for","single","process","operation"]
code: def all_reduce(
      self, tensor: Any | torch.Tensor, *args: Any, **kwargs: Any
  ) -> Any | torch.Tensor:
      """Reduces a tensor from several distributed processes to one aggregated tensor. As this plugin only operates
      with a single device, the reduction is simply the identity.
  
      Args:
          tensor: the tensor to sync and reduce
          *args: ignored
          **kwargs: ignored
  
      Return:
          the unmodified input as reduction is not needed for single process operation
  
      """
      return tensor
  
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 5 for calling the SingleDeviceStrategy obj's underlying member method code with example usage: obj.all_reduce(tensor) and returns: tensor