code: def test_unsupported_strategies(strategy_class):
      """Test that an error is raised for strategies that require the gradient accumulation factor to be fixed."""
      scheduler = GradientAccumulationScheduler({1: 2})
      model = BoringModel()
      trainer = Trainer()
      trainer._accelerator_connector.strategy = Mock(
          spec=strategy_class
      )
      with pytest.raises(
          RuntimeError,
          match="does not support `accumulate_grad_batches` changing between epochs",
      ):
          scheduler.on_train_start(trainer, model)
  
file_path: pytorch-lightning/tests/tests_pytorch/callbacks/test_gradient_accumulation_scheduler.py
imports: import math
  from unittest.mock import Mock, patch
  import pytest
  from lightning.pytorch import Trainer
  from lightning.pytorch.callbacks import GradientAccumulationScheduler
  from lightning.pytorch.demos.boring_classes import BoringModel
  from lightning.pytorch.strategies import DeepSpeedStrategy
  from lightning.pytorch.utilities.exceptions import MisconfigurationException
  from lightning.pytorch.utilities.imports import _LIGHTNING_COLOSSALAI_AVAILABLE
label_desc: Use image node_id 5 for calling a global function with example usage: test_unsupported_strategies(strategy_class) without return types