mirror of
https://github.com/wassname/DeepRL.git
synced 2026-10-28 12:30:38 +08:00
Support python 2.7
This commit is contained in:
1 parent
a6bcf9e5a7
commit
8e11d762e7
3 files changed
+10
-4
No files matched your search
+7
-2
@@ -9,8 +9,13 @@ import pickle
|
||||
import os
|
||||
import datetime
|
||||
import uuid
|
||||
import pathlib
|
||||
import torch
|
||||
try:
|
||||
# python >= 3.5
|
||||
from pathlib import Path
|
||||
except:
|
||||
# python == 2.7
|
||||
from pathlib2 import Path
|
||||
|
||||
def run_episodes(agent):
|
||||
config = agent.config
|
||||
@@ -83,7 +88,7 @@ def sync_grad(target_network, src_network):
|
||||
param._grad = src_param.grad.clone()
|
||||
|
||||
def mkdir(path):
|
||||
pathlib.Path(path).mkdir(parents=True, exist_ok=True)
|
||||
Path(path).mkdir(parents=True, exist_ok=True)
|
||||
|
||||
def set_one_thread():
|
||||
os.environ['OMP_NUM_THREADS'] = '1'
|
||||
|
||||
Reference in new issue
Block a user