2020-04-02 16:28:44 +00:00
|
|
|
import os
|
|
|
|
|
2020-04-22 00:33:10 +00:00
|
|
|
import numpy as np
|
|
|
|
import torch
|
|
|
|
|
2020-04-02 16:28:44 +00:00
|
|
|
TEST_ROOT = os.path.dirname(__file__)
|
2020-04-22 00:33:10 +00:00
|
|
|
PACKAGE_ROOT = os.path.dirname(TEST_ROOT)
|
|
|
|
TEMP_PATH = os.path.join(PACKAGE_ROOT, 'test_temp')
|
|
|
|
|
|
|
|
# generate a list of random seeds for each test
|
|
|
|
RANDOM_PORTS = list(np.random.randint(12000, 19000, 1000))
|
|
|
|
ROOT_SEED = 1234
|
|
|
|
torch.manual_seed(ROOT_SEED)
|
|
|
|
np.random.seed(ROOT_SEED)
|
|
|
|
RANDOM_SEEDS = list(np.random.randint(0, 10000, 1000))
|
|
|
|
|
|
|
|
if not os.path.isdir(TEMP_PATH):
|
|
|
|
os.mkdir(TEMP_PATH)
|