ray.rllib.policy.sample_batch.SampleBatch.concat
ray.rllib.policy.sample_batch.SampleBatch.concat#
- SampleBatch.concat(other: ray.rllib.policy.sample_batch.SampleBatch) ray.rllib.policy.sample_batch.SampleBatch[source]#
Concatenates
otherto this one and returns a new SampleBatch.- Parameters
other – The other SampleBatch object to concat to this one.
- Returns
The new SampleBatch, resulting from concating
othertoself.
Examples
>>> import numpy as np >>> from ray.rllib.policy.sample_batch import SampleBatch >>> b1 = SampleBatch({"a": np.array([1, 2])}) >>> b2 = SampleBatch({"a": np.array([3, 4, 5])}) >>> print(b1.concat(b2)) {"a": np.array([1, 2, 3, 4, 5])}