[RLlib] Add __len__() method to SampleBatch (#13371)

This commit is contained in:
Maltimore authored and GitHub committed 2021-01-12 20:15:23 +01:00
1 parent e560933f9c
commit 3a3e4aed86
1 file changed
+5
+5
View File
@@ -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"]) -> \