[rllib] Give error if sample_async is used with pytorch for A3C (#5000)

* give error if sample_async is used with pytorch

* update

* Update a3c.py
This commit is contained in:
Philipp Moritz
2019-06-25 22:06:36 -07:00
committed by Eric Liang
parent bb8e75b532
commit bbe3e5b4ed
+4
View File
@@ -48,6 +48,10 @@ def get_policy_class(config):
def validate_config(config):
if config["entropy_coeff"] < 0:
raise DeprecationWarning("entropy_coeff must be >= 0")
if config["sample_async"] and config["use_pytorch"]:
raise ValueError(
"The sample_async option is not supported with use_pytorch: "
"Multithreading can be lead to crashes if used with pytorch.")
def make_async_optimizer(workers, config):