a | b/ecg_gan/config.py | ||
---|---|---|---|
1 | import numpy as np |
||
2 | import torch |
||
3 | |||
4 | |||
5 | class Config: |
||
6 | csv_path = '' |
||
7 | seed = 2021 |
||
8 | device = 'cuda:0' if torch.cuda.is_available() else 'cpu' |
||
9 | |||
10 | def seed_everything(seed: int): |
||
11 | np.random.seed(seed) |
||
12 | torch.manual_seed(seed) |
||
13 | if torch.cuda.is_available(): |
||
14 | torch.cuda.manual_seed(seed) |
||
15 | |||
16 | |||
17 | if __name__ == '__main__': |
||
18 | config = Config() |
||
19 | seed_everything(config.seed) |