Shortcuts

mmengine.runner.set_random_seed

mmengine.runner.set_random_seed(seed=None, deterministic=False, diff_rank_seed=False)[源代码]

Set random seed.

参数:
  • seed (int, optional) – Seed to be used.

  • deterministic (bool) – Whether to set the deterministic option for CUDNN backend, i.e., set torch.backends.cudnn.deterministic to True and torch.backends.cudnn.benchmark to False. Defaults to False.

  • diff_rank_seed (bool) – Whether to add rank number to the random seed to have different random seed in different threads. Defaults to False.

返回类型:

int