mirror of
https://github.com/vale981/ray
synced 2025-03-06 10:31:39 -05:00
[rllib] rename async -> _async (#2097)
async and await are reserved words in Python 3.7, and will give a syntax error.
This commit is contained in:
parent
eba73449cc
commit
8e0962bb9c
2 changed files with 3 additions and 3 deletions
|
@ -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
|
||||
|
||||
|
|
|
@ -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(
|
||||
|
|
Loading…
Add table
Reference in a new issue