From 8e0962bb9c14253c01c97ea41bd715f952712e5b Mon Sep 17 00:00:00 2001 From: Alok Singh <8325708+alok@users.noreply.github.com> Date: Sat, 19 May 2018 14:16:52 -0700 Subject: [PATCH] [rllib] rename async -> _async (#2097) async and await are reserved words in Python 3.7, and will give a syntax error. --- python/ray/rllib/a3c/a3c_evaluator.py | 2 +- python/ray/rllib/utils/sampler.py | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/python/ray/rllib/a3c/a3c_evaluator.py b/python/ray/rllib/a3c/a3c_evaluator.py index 9b0522dfd..74d201016 100644 --- a/python/ray/rllib/a3c/a3c_evaluator.py +++ b/python/ray/rllib/a3c/a3c_evaluator.py @@ -45,7 +45,7 @@ class A3CEvaluator(PolicyEvaluator): "rew_filter": self.rew_filter} self.sampler = AsyncSampler(env, self.policy, self.obs_filter, config["batch_size"]) - if start_sampler and self.sampler.async: + if start_sampler and self.sampler._async: self.sampler.start() self.logdir = logdir diff --git a/python/ray/rllib/utils/sampler.py b/python/ray/rllib/utils/sampler.py index 8adc99605..242464dbf 100644 --- a/python/ray/rllib/utils/sampler.py +++ b/python/ray/rllib/utils/sampler.py @@ -90,7 +90,7 @@ class SyncSampler(object): This class provides data on invocation, rather than on a separate thread.""" - async = False + _async = False def __init__(self, env, policy, obs_filter, num_local_steps, horizon=None): self.num_local_steps = num_local_steps @@ -126,7 +126,7 @@ class AsyncSampler(threading.Thread): Note that batch_size is only a unit of measure here. Batches can accumulate and the gradient can be calculated on up to 5 batches.""" - async = True + _async = True def __init__(self, env, policy, obs_filter, num_local_steps, horizon=None): assert getattr(