ray.rllib.evaluation.worker_set.WorkerSet.foreach_policy_to_train
ray.rllib.evaluation.worker_set.WorkerSet.foreach_policy_to_train#
- WorkerSet.foreach_policy_to_train(func: Callable[[ray.rllib.policy.policy.Policy, str], ray.rllib.evaluation.worker_set.T]) List[ray.rllib.evaluation.worker_set.T] [source]#
Apply
func
to all workers’ Policies iff inpolicies_to_train
.- Parameters
func – A function - taking a Policy and its ID - that is called on all workers’ Policies, for which
worker.is_policy_to_train()
returns True.- Returns
- The list of n return values of all
func([trainable policy], [ID])
-calls.
- Return type
List[any]