Change os.uname()[1] and socket.gethostname() to the portable and faster platform.node_ip() (#8839)

Co-authored-by: Mehrdad <noreply@github.com>
This commit is contained in:
mehrdadn
2020-06-08 21:29:46 -07:00
committed by GitHub
co-authored by Mehrdad
parent d2ef29f0d2
commit f93bb008bb
15 changed files with 31 additions and 27 deletions
+2 -2
View File
@@ -1,7 +1,7 @@
import numpy as np
import random
import os
import collections
import platform
import sys
import ray
@@ -343,7 +343,7 @@ class LocalReplayBuffer(ParallelIteratorWorker):
return _local_replay_buffer
def get_host(self):
return os.uname()[1]
return platform.node()
def add_batch(self, batch):
# Make a copy so the replay buffer doesn't pin plasma memory.