[rllib] Copy plasma memory before adding data to replay buffer

This commit is contained in:
Eric Liang
2020-04-29 14:17:54 -07:00
committed by SangBin Cho
parent e9a361a86f
commit 97d6509cf8
@@ -323,6 +323,8 @@ class LocalReplayBuffer(ParallelIteratorWorker):
return os.uname()[1]
def add_batch(self, batch):
# Make a copy so the replay buffer doesn't pin plasma memory.
batch = batch.copy()
# Handle everything as if multiagent
if isinstance(batch, SampleBatch):
batch = MultiAgentBatch({DEFAULT_POLICY_ID: batch}, batch.count)