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

This commit is contained in:
Maltimore
2021-01-12 20:15:23 +01:00
committed by GitHub
parent e560933f9c
commit 3a3e4aed86
+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"]) -> \