class_docstr: Triggers `policy_saver` save calls in a separate thread asynchronously.
class_docstr_tok: ["Triggers","`","policy_saver","`","save","calls","in","a","separate","thread","asynchronously","."]
docstr: Initialize an AsyncPolicySaver.
  
  Args:
    policy_saver: An instance of a `policy_saver.PolicySaver`.
docstr_tok: ["Initialize","an","AsyncPolicySaver",".","Args",":","policy_saver",":","An","instance","of","a","`","policy_saver.PolicySaver","`","."]
code: def __init__(self, policy_saver: policy_saver_module.PolicySaver):
      """Initialize an AsyncPolicySaver.
  
      Args:
        policy_saver: An instance of a `policy_saver.PolicySaver`.
      """
      self._policy_saver = policy_saver
      self._save_condition_variable = threading.Condition()
  
      # These vars should only be accessed if the lock in save_condition is held.
      # export_dir is set to None whenever there is no pending save. Otherwise it
      # is used to communicate across threads.
      self._export_dir = None
      self._saving_checkpoint = False
      self._join_save_thread = False
  
      self._save_thread = threading.Thread(target=self._save_loop)
      self._save_thread.start()
  
file_path: agents/tf_agents/policies/async_policy_saver.py
imports: import threading
  from typing import Text
  from absl import logging
  from tf_agents.policies import policy_saver
label_desc: Use image node_id 1 to create a new AsyncPolicySaver object from inherited base classes: object with example: obj = AsyncPolicySaver(policy_saver)