class_docstr: Background thread that updates the local model from replay data.
  
  The learner thread communicates with the main thread through Queues. This
  is needed since Ray operations can only be run on the main thread. In
  addition, moving heavyweight gradient ops session runs off the main thread
  improves overall throughput.
class_docstr_tok: ["Background","thread","that","updates","the","local","model","from","replay","data",".","The","learner","thread","communicates","with","the","main","thread","through","Queues",".","This","is","needed","since","Ray","operations","can","only","be","run","on","the","main","thread",".","In","addition",",","moving","heavyweight","gradient","ops","session","runs","off","the","main","thread","improves","overall","throughput","."]
code: def __init__(self, local_worker):
      threading.Thread.__init__(self)
      self.learner_queue_size = WindowStat("size", 50)
      self.local_worker = local_worker
      self.inqueue = queue.Queue(maxsize=LEARNER_QUEUE_MAX_SIZE)
      self.outqueue = queue.Queue()
      self.queue_timer = _Timer()
      self.grad_timer = _Timer()
      self.overall_timer = _Timer()
      self.daemon = True
      self.policy_ids_updated = []
      self.stopped = False
      self.learner_info = {}
  
file_path: ray/rllib/algorithms/dqn/learner_thread.py
imports: import queue
  import threading
  from ray.util.timer import _Timer
  from ray.rllib.utils.framework import try_import_tf
  from ray.rllib.utils.metrics.learner_info import LearnerInfoBuilder
  from ray.rllib.utils.metrics.window_stat import WindowStat
label_desc: Use image node_id 1 to create a new LearnerThread object from inherited base classes: threading with example: obj = LearnerThread(local_worker)