ray.rllib.policy.sample_batch.SampleBatch.compress#

SampleBatch.compress(bulk: bool = False, columns: Set[str] = frozenset({'new_obs', 'obs'})) SampleBatch[source]#

Compresses the data buffers (by column) in place.

Parameters:
  • bulk – Whether to compress across the batch dimension (0) as well. If False will compress n separate list items, where n is the batch size.

  • columns – The columns to compress. Default: Only compress the obs and new_obs columns.

Returns:

This very (now compressed) SampleBatch.