class_docstr: Dummy implementation of distributed actors creates the actors as a list. Once the outputs are to
      be collected, it simply rolls them out in a loop until is has enough to be returned.
  
  :param actor_env_seeds: A list of seeds for each actors' env.
class_docstr_tok: ["Dummy","implementation","of","distributed","actors","creates","the","actors","as","a","list",".","Once","the","outputs","are","to","be","collected",",","it","simply","rolls","them","out","in","a","loop","until","is","has","enough","to","be","returned",".",":","param","actor_env_seeds",":","A","list","of","seeds","for","each","actors","'","env","."]
docstr: Run the rollouts and collect the outputs.
docstr_tok: ["Run","the","rollouts","and","collect","the","outputs","."]
code: def collect_outputs(
      self, learner_device: str
  ) -> Tuple[StructuredSpacesRecord, float, float, float]:
      """Run the rollouts and collect the outputs."""
      start_wait_time = time.time()
      trajectories = []
  
      while len(trajectories) < self.batch_size:
          trajectory = self.actors[self.current_actor_idx].rollout(
              policy=self.policy, n_steps=self.n_rollout_steps
          )
  
          # collect episode statistics
          for record in trajectory.step_records:
              if record.episode_stats is not None:
                  self.epoch_stats.receive(record.episode_stats)
  
          trajectories.append(trajectory)
          self.current_actor_idx = (
              self.current_actor_idx + 1
              if self.current_actor_idx < len(self.actors) - 1
              else 0
          )
  
      stacked_record = SpacesTrajectoryRecord.stack_trajectories(
          trajectories
      ).stack()
      dequeue_time = time.time() - start_wait_time
      return (
          stacked_record.to_torch(device=learner_device),
          0,
          0,
          dequeue_time,
      )
  
imports: import time
  from typing import Callable, Union, List, Tuple, Dict
  from maze.core.agent.torch_policy import TorchPolicy
  from maze.core.annotations import override
  from maze.core.env.structured_env import StructuredEnv
  from maze.core.env.structured_env_spaces_mixin import StructuredEnvSpacesMixin
  from maze.core.log_stats.log_stats_env import LogStatsEnv
  from maze.core.rollout.rollout_generator import RolloutGenerator
  from maze.core.trajectory_recording.records.structured_spaces_record import StructuredSpacesRecord
  from maze.core.trajectory_recording.records.trajectory_record import SpacesTrajectoryRecord
  from maze.perception.perception_utils import convert_to_torch
  from maze.train.parallelization.broadcasting_container import BroadcastingContainer
  from maze.train.parallelization.distributed_actors.distributed_actors import DistributedActors
  from maze.utils.bcolors import BColors
label_desc: Use image node_id 5 for calling the SequentialDistributedActors obj's underlying member method code with example usage: obj.collect_outputs(learner_device) and returns: stacked_record,  int,  int,  dequeue_time