ray.rllib.policy.Policy.apply
ray.rllib.policy.Policy.apply#
- Policy.apply(func: Callable[[ray.rllib.policy.policy.Policy, Optional[Any], Optional[Any]], ray.rllib.utils.typing.T], *args, **kwargs) ray.rllib.utils.typing.T [source]#
Calls the given function with this Policy instance.
Useful for when the Policy class has been converted into a ActorHandle and the user needs to execute some functionality (e.g. add a property) on the underlying policy object.
- Parameters
func – The function to call, with this Policy as first argument, followed by args, and kwargs.
args – Optional additional args to pass to the function call.
kwargs – Optional additional kwargs to pass to the function call.
- Returns
The return value of the function call.