mirror of
https://github.com/wassname/ray.git
synced 2026-06-27 17:49:47 +08: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:
committed by
Robert Nishihara
parent
eba73449cc
commit
8e0962bb9c
@@ -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(
|
||||
|
||||
Reference in New Issue
Block a user