mirror of
https://github.com/wassname/ray.git
synced 2026-10-01 12:31:37 +08:00
[RLlib] Add __len__() method to SampleBatch (#13371)
This commit is contained in:
1 parent
e560933f9c
commit
3a3e4aed86
1 file changed
+5
@@ -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"]) -> \
|
||||
|
||||
Reference in new issue
Block a user