import torch
import numpy as np
import random

def set_random_seed(seed):
    torch.manual_seed(seed)  # Set seed for PyTorch
    torch.cuda.manual_seed(seed)  # If using GPU
    torch.cuda.manual_seed_all(seed)  # If using multi-GPU
    random.seed(seed)  # Set seed for Python's random module
    np.random.seed(seed)  # Set seed for NumPy
    torch.backends.cudnn.deterministic = True  # Ensures reproducibility (slower)
    torch.backends.cudnn.benchmark = False  # Ensures reproducibility (may impact speed)

