class_docstr: Triggers saves policy checkpoints an agent's policy.
  
  On construction this trigger will generate a saved_model for a:
  `greedy_policy`, a `collect_policy`, and a `raw_policy`. When triggered a
  checkpoint will be saved which can be used to updated any of the saved_model
  policies.
class_docstr_tok: ["Triggers","saves","policy","checkpoints","an","agent","'s","policy",".","On","construction","this","trigger","will","generate","a","saved_model","for","a",":","`","greedy_policy","`",",","a","`","collect_policy","`",",","and","a","`","raw_policy","`",".","When","triggered","a","checkpoint","will","be","saved","which","can","be","used","to","updated","any","of","the","saved_model","policies","."]
code: def _build_saver(
      self,
      policy: tf_policy.TFPolicy,
      batch_size: Optional[int] = None,
      use_nest_path_signatures: bool = True,
  ) -> Union[
      policy_saver.PolicySaver, async_policy_saver.AsyncPolicySaver
  ]:
      saver = policy_saver.PolicySaver(
          policy,
          batch_size=batch_size,
          train_step=self._train_step,
          metadata=self._metadata,
          use_nest_path_signatures=use_nest_path_signatures,
          input_fn_and_spec=self._input_fn_and_spec,
      )
      if self._async_saving:
          saver = async_policy_saver.AsyncPolicySaver(saver)
      return saver
  
imports: import os
  from typing import Mapping, Optional, Sequence, Text, Tuple, Union
  from absl import logging
  import tensorflow.compat.v2
  from tf_agents.agents import tf_agent
  from tf_agents.metrics import py_metric
  from tf_agents.policies import async_policy_saver
  from tf_agents.policies import greedy_policy
  from tf_agents.policies import policy_saver
  from tf_agents.policies import tf_policy
  from tf_agents.train import interval_trigger
  from tf_agents.train import learner
  from tf_agents.train import step_per_second_tracker
  from tf_agents.typing import types
label_desc: Use image node_id 2 for calling the PolicySavedModelTrigger obj's underlying member method code with example usage: obj._build_saver(policy, batch_size, use_nest_path_signatures) and returns: saver