Missed TensorFlow Dev Summit? Check out the video playlist. Watch recordings

tf_agents.trajectories.time_step.time_step_spec

View source on GitHub

Returns a TimeStep spec given the observation_spec.

tf_agents.trajectories.time_step.time_step_spec(
    observation_spec=None, reward_spec=None
)

Used in the notebooks

Used in the tutorials

Args:

  • observation_spec: A nest of tf.TypeSpec or ArraySpec objects.
  • reward_spec: (Optional) A nest of tf.TypeSpec or ArraySpec objects. Default - a scalar float32 of the same type (Tensor or Array) as observation_spec.

Returns:

A TimeStep with the same types (TypeSpec or ArraySpec) as the first entry in observation_spec.

Raises:

  • TypeError: If observation and reward specs aren't both either tensor type specs or array type specs.