File tree Expand file tree Collapse file tree 1 file changed +2
-2
lines changed Expand file tree Collapse file tree 1 file changed +2
-2
lines changed Original file line number Diff line number Diff line change @@ -347,7 +347,7 @@ def _rollout_yield_trajs(self) -> TensorDictBase: # A simplified version of rol
347
347
queue .append (_data )
348
348
dones [i ] = _data ["next" , "done" ].any ()
349
349
if dones .any ():
350
- for idx in dones .nonzero ()[0 ].tolist ():
350
+ for idx in dones .nonzero (as_tuple = True )[0 ].tolist ():
351
351
if not self .yield_only_last_steps :
352
352
self ._trajectory_queue .append (
353
353
lazy_stack (self ._yield_queues [idx ], - 1 )
@@ -401,7 +401,7 @@ def _rollout_yield_trajs_async(
401
401
queue .append (_data )
402
402
dones [i ] = _data ["next" , "done" ].any ()
403
403
if dones .any ():
404
- for idx in dones .nonzero ()[0 ].tolist ():
404
+ for idx in dones .nonzero (as_tuple = True )[0 ].tolist ():
405
405
if not self .yield_only_last_steps :
406
406
self ._trajectory_queue .append (
407
407
lazy_stack (self ._yield_queues [idx ], - 1 )
You can’t perform that action at this time.
0 commit comments