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: Triggers an async save of the policy to the given `export_dir`.
  
  Only one save can be triggered at a time. If `save` or `save_checkpoint`
  are called while another save of either kind is still ongoing the saving is
  skipped.
  
  If blocking is set then the call will block until any ongoing saves finish,
  and then a new save will be made before returning.
  
  Args:
    export_dir: Directory path for the `saved_model` of the policy.
    blocking: If True the call to save will block until a save can be
      performed and finished. If a save was ongoing it will wait for that to
      finish, and then do a blocking save before returning.
docstr_tok: ["Triggers","an","async","save","of","the","policy","to","the","given","`","export_dir","`",".","Only","one","save","can","be","triggered","at","a","time",".","If","`","save","`","or","`","save_checkpoint","`","are","called","while","another","save","of","either","kind","is","still","ongoing","the","saving","is","skipped",".","If","blocking","is","set","then","the","call","will","block","until","any","ongoing","saves","finish",",","and","then","a","new","save","will","be","made","before","returning",".","Args",":","export_dir",":","Directory","path","for","the","`","saved_model","`","of","the","policy",".","blocking",":","If","True","the","call","to","save","will","block","until","a","save","can","be","performed","and","finished",".","If","a","save","was","ongoing","it","will","wait","for","that","to","finish",",","and","then","do","a","blocking","save","before","returning","."]
code: def save(self, export_dir: Text, blocking: bool = False):
      """Triggers an async save of the policy to the given `export_dir`.
  
      Only one save can be triggered at a time. If `save` or `save_checkpoint`
      are called while another save of either kind is still ongoing the saving is
      skipped.
  
      If blocking is set then the call will block until any ongoing saves finish,
      and then a new save will be made before returning.
  
      Args:
        export_dir: Directory path for the `saved_model` of the policy.
        blocking: If True the call to save will block until a save can be
          performed and finished. If a save was ongoing it will wait for that to
          finish, and then do a blocking save before returning.
      """
      self._save(export_dir, saving_checkpoint=False, blocking=blocking)
  
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 4 for calling the AsyncPolicySaver obj's underlying member method code with example usage: obj.save(export_dir, blocking) without return types