class_docstr: Exception to be raised with Training Spikes.
code: def __init__(self, batch_idx: int, *args: Any, **kwargs: Any):
      super().__init__(
          f"Training spike detected in batch {batch_idx}",
          *args,
          **kwargs,
      )
  
imports: import json
  import operator
  import os
  import warnings
  from typing import TYPE_CHECKING, Any, Dict, List, Literal, Optional, Union
  import torch
  from lightning_utilities.core.imports import compare_version
  from lightning.fabric.utilities.types import _PATH
label_desc: Use image node_id 1 to create a new TrainingSpikeException object from inherited base classes: RuntimeError with example: obj = TrainingSpikeException(batch_idx)