mirror of
https://github.com/wassname/ray.git
synced 2026-10-01 12:31:37 +08:00
[rllib] Copy plasma memory before adding data to replay buffer
This commit is contained in:
1 parent
e9a361a86f
commit
97d6509cf8
1 file changed
+2
@@ -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