ray.rllib.env.env_runner_group.EnvRunnerGroup.foreach_policy_to_train#

EnvRunnerGroup.foreach_policy_to_train(func: Callable[[Policy, str], T]) List[T][source]#

Apply func to all workers’ Policies iff in policies_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]

DeveloperAPI: This API may change across minor Ray releases.