policies/utils.py
This commit is contained in:
parent
a420714ee4
commit
c17dffe944
10
lerobot/common/policies/utils.py
Normal file
10
lerobot/common/policies/utils.py
Normal file
@ -0,0 +1,10 @@
|
|||||||
|
def populate_queues(queues, batch):
|
||||||
|
for key in batch:
|
||||||
|
if len(queues[key]) != queues[key].maxlen:
|
||||||
|
# initialize by copying the first observation several times until the queue is full
|
||||||
|
while len(queues[key]) != queues[key].maxlen:
|
||||||
|
queues[key].append(batch[key])
|
||||||
|
else:
|
||||||
|
# add latest observation to the queue
|
||||||
|
queues[key].append(batch[key])
|
||||||
|
return queues
|
||||||
Loading…
x
Reference in New Issue
Block a user