Module neuralops.utils.seed

Functions

def set_all_seeds(seed: int) ‑> None
Expand source code
def set_all_seeds(seed: int) -> None:
    """Set the all seeds."""
    random.seed(seed)
    np.random.seed(seed)
    torch.manual_seed(seed)
    if torch.cuda.is_available():
        torch.cuda.manual_seed_all(seed)
        torch.backends.cudnn.deterministic = True
        torch.backends.cudnn.benchmark = False

Set the all seeds.