ray.rllib.policy.eager_tf_policy_v2.EagerTFPolicyV2.from_state#

static EagerTFPolicyV2.from_state(state: Dict[str, numpy.array | jnp.ndarray | tf.Tensor | torch.Tensor | dict | tuple]) Policy#

Recovers a Policy from a state object.

The state of an instantiated Policy can be retrieved by calling its get_state method. This only works for the V2 Policy classes (EagerTFPolicyV2, SynamicTFPolicyV2, and TorchPolicyV2). It contains all information necessary to create the Policy. No access to the original code (e.g. configs, knowledge of the policy’s class, etc..) is needed.

Parameters:

state – The state to recover a new Policy instance from.

Returns:

A new Policy instance.