Skip to content

Commit

Permalink
[Nit] Stack video frames before transpose
Browse files Browse the repository at this point in the history
  • Loading branch information
matteobettini committed Apr 24, 2024
1 parent 1088fc3 commit 2a85cd9
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions benchmarl/experiment/logger.py
Original file line number Diff line number Diff line change
Expand Up @@ -224,10 +224,11 @@ def log_evaluation(

self.log(to_log, step=step)
if video_frames is not None and rollouts[0].batch_size[0] > 1:
video_frames = np.stack(
video_frames[: rollouts[0].batch_size[0] - 1], axis=0
)
vid = torch.tensor(
np.transpose(
video_frames[: rollouts[0].batch_size[0] - 1], (0, 3, 1, 2)
),
np.transpose(video_frames, (0, 3, 1, 2)),
dtype=torch.uint8,
).unsqueeze(0)
for logger in self.loggers:
Expand Down

0 comments on commit 2a85cd9

Please sign in to comment.