From 5e91086c17fd6de85f4d53873fab17e049dd5df5 Mon Sep 17 00:00:00 2001 From: Shangtong Zhang Date: Fri, 25 May 2018 19:52:58 -0600 Subject: [PATCH] Fix a bug for single process --- deep_rl/component/task.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/deep_rl/component/task.py b/deep_rl/component/task.py index 6a0f3c8..95ba2f6 100644 --- a/deep_rl/component/task.py +++ b/deep_rl/component/task.py @@ -196,6 +196,7 @@ class ParallelizedTask: self.state_dim = self.tasks[0].state_dim self.action_dim = self.tasks[0].action_dim self.name = self.tasks[0].name + self.single_process = single_process def step(self, actions): results = [task.step(action) for task, action in zip(self.tasks, actions)] @@ -207,4 +208,6 @@ class ParallelizedTask: return np.stack(results) def close(self): + if self.single_process: + return for task in self.tasks: task.close() \ No newline at end of file