mirror of
https://github.com/wassname/ray.git
synced 2026-08-07 11:27:43 +08:00
[rllib] Copy plasma memory before adding data to replay buffer
This commit is contained in:
@@ -323,6 +323,8 @@ class LocalReplayBuffer(ParallelIteratorWorker):
|
|||||||
return os.uname()[1]
|
return os.uname()[1]
|
||||||
|
|
||||||
def add_batch(self, batch):
|
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
|
# Handle everything as if multiagent
|
||||||
if isinstance(batch, SampleBatch):
|
if isinstance(batch, SampleBatch):
|
||||||
batch = MultiAgentBatch({DEFAULT_POLICY_ID: batch}, batch.count)
|
batch = MultiAgentBatch({DEFAULT_POLICY_ID: batch}, batch.count)
|
||||||
|
|||||||
Reference in New Issue
Block a user