class_docstr: The base class for all distributed actors.
  
  Distributed actors run rollouts independently. Rollouts are recorded and made available in batches
  to be used during training. When a new policy version is made available, it is distributed to all actors.
  
  :param env_factory: Factory function for envs to run rollouts on.
  :param policy: Structured policy to sample actions from.
  :param n_rollout_steps: Number of rollouts steps to record in one rollout.
  :param n_actors: Number of distributed actors to run simultaneously.
  :param batch_size: Size of the batch the rollouts are collected in.
class_docstr_tok: ["The","base","class","for","all","distributed","actors",".","Distributed","actors","run","rollouts","independently",".","Rollouts","are","recorded","and","made","available","in","batches","to","be","used","during","training",".","When","a","new","policy","version","is","made","available",",","it","is","distributed","to","all","actors",".",":","param","env_factory",":","Factory","function","for","envs","to","run","rollouts","on",".",":","param","policy",":","Structured","policy","to","sample","actions","from",".",":","param","n_rollout_steps",":","Number","of","rollouts","steps","to","record","in","one","rollout",".",":","param","n_actors",":","Number","of","distributed","actors","to","run","simultaneously",".",":","param","batch_size",":","Size","of","the","batch","the","rollouts","are","collected","in","."]
docstr: Collect `self.batch_size` actor outputs from the queue and return them batched where the first dim is
  time and the second is the batch size.
  
  :param learner_device: the device of the learner
  :return: A tuple of (1) batched version of ActorOutputs, (2) queue size before de-queueing,
           (3) queue size after dequeueing, and (4) the time it took to dequeue the outputs
docstr_tok: ["Collect","`","self.batch_size","`","actor","outputs","from","the","queue","and","return","them","batched","where","the","first","dim","is","time","and","the","second","is","the","batch","size",".",":","param","learner_device",":","the","device","of","the","learner",":","return",":","A","tuple","of","(","1",")","batched","version","of","ActorOutputs",",","(","2",")","queue","size","before","de-queueing",",","(","3",")","queue","size","after","dequeueing",",","and","(","4",")","the","time","it","took","to","dequeue","the","outputs"]
code: def collect_outputs(
      self, learner_device: str
  ) -> Tuple[StructuredSpacesRecord, float, float, float]:
      """Collect `self.batch_size` actor outputs from the queue and return them batched where the first dim is
      time and the second is the batch size.
  
      :param learner_device: the device of the learner
      :return: A tuple of (1) batched version of ActorOutputs, (2) queue size before de-queueing,
               (3) queue size after dequeueing, and (4) the time it took to dequeue the outputs
      """
      raise NotImplementedError
  
file_path: maze/maze/train/parallelization/distributed_actors/distributed_actors.py
imports: from abc import abstractmethod
  from typing import Tuple, Callable, Optional, Union, Dict
  from maze.core.agent.torch_policy import TorchPolicy
  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 import LogStatsAggregator, LogStatsLevel, get_stats_logger, LogStatsValue
  from maze.core.log_stats.log_stats_env import LogStatsEnv
  from maze.core.trajectory_recording.records.structured_spaces_record import StructuredSpacesRecord
label_desc: Use image node_id 5 for calling the DistributedActors obj's underlying member method code with example usage: obj.collect_outputs(learner_device) without return types