tf_agents.trajectories.time_step.time_step_spec

Returns a TimeStep spec given the observation_spec.

Used in the notebooks

Used in the tutorials

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.

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

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