ray.rllib.utils.checkpoints.Checkpointable.get_state#

abstract Checkpointable.get_state(components: str | Collection[str] | None = None, *, not_components: str | Collection[str] | None = None, **kwargs) Dict[str, Any][source]#

Returns the implementing class’s current state as a dict.

Parameters:
  • components – An optional collection of string keys to be included in the returned state. This might be useful, if getting certain components of the state is expensive (e.g. reading/compiling the weights of a large NN) and at the same time, these components are not required by the caller.

  • not_components – An optional list of string keys to be excluded in the returned state, even if the same string is part of components. This is useful to get the complete state of the class, except one or a few components.

  • kwargs – Forward-compatibility kwargs.

Returns:

The current state of the implementing class (or only the components specified, w/o those in not_components).