ray.rllib.evaluation.rollout_worker.RolloutWorker.foreach_env_with_context
ray.rllib.evaluation.rollout_worker.RolloutWorker.foreach_env_with_context#
- RolloutWorker.foreach_env_with_context(func: Callable[[Any, ray.rllib.env.env_context.EnvContext], ray.rllib.utils.typing.T]) List[ray.rllib.utils.typing.T] [source]#
Calls given function with each sub-env plus env_ctx as args.
- Parameters
func – The function to call for each underlying sub-environment and its EnvContext (as the args).
- Returns
The list of return values of all calls to
func([env, ctx])
.