ray.rllib.policy.sample_batch.SampleBatch.timeslices#

SampleBatch.timeslices(size: int | None = None, num_slices: int | None = None, k: int | None = None) List[SampleBatch][source]#

Returns SampleBatches, each one representing a k-slice of this one.

Will start from timestep 0 and produce slices of size=k.

Parameters:
  • size – The size (in timesteps) of each returned SampleBatch.

  • num_slices – The number of slices to produce.

  • k – Deprecated: Use size or num_slices instead. The size (in timesteps) of each returned SampleBatch.

Returns:

The list of num_slices (new) SampleBatches or n (new) SampleBatches each one of size size.