code: def test_single_device_collectives():
      """Test that collectives in the single-device strategy act as the identity."""
      strategy = SingleDeviceStrategy()
      tensor = Mock()
      assert strategy.all_gather(tensor) == tensor
      assert strategy.all_reduce(tensor) == tensor
      assert strategy.broadcast(tensor) == tensor
  
file_path: pytorch-lightning/tests/tests_fabric/strategies/test_single_device.py
imports: from unittest.mock import Mock
  import pytest
  import torch
  from lightning.fabric import Fabric
  from lightning.fabric.strategies import SingleDeviceStrategy
  from tests_fabric.helpers.runif import RunIf
label_desc: Use image node_id 4 for calling a global function with example usage: test_single_device_collectives() without return types