diff --git a/rllib/policy/sample_batch.py b/rllib/policy/sample_batch.py index 08dfa2227..162c62499 100644 --- a/rllib/policy/sample_batch.py +++ b/rllib/policy/sample_batch.py @@ -86,6 +86,11 @@ class SampleBatch: # Keeps track of new columns added after initial ones. self.new_columns = [] + @PublicAPI + def __len__(self): + """Returns the amount of samples in the sample batch.""" + return self.count + @staticmethod @PublicAPI def concat_samples(samples: List["SampleBatch"]) -> \