mirror of
https://github.com/wassname/ray.git
synced 2026-08-11 11:24:51 +08:00
[RLlib] Add __len__() method to SampleBatch (#13371)
This commit is contained in:
@@ -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