code: def load(
      saved_model_path: Text, checkpoint_path: Optional[Text] = None
  ):
      """Loads a policy.
  
      The argument `saved_model_path` is the path of a directory containing a full
      saved model for the policy. The path typically looks like
      '/root_dir/policies/policy', it may contain trailing numbers for the
      train_step.
  
      `saved_model_path` is expected to contain the following files. (There can be
      additional shards for the `variables.data` files.)
         * `saved_model.pb`
         * `policy_specs.pbtxt`
         * `variables/variables.index`
         * `variables/variables.data-00000-of-00001`
  
      The optional argument `checkpoint_path` is the path to a directory that
      contains variable checkpoints (as opposed to full saved models) for the
      policy. The path also typically ends-up with the checkpoint number,
      for example: '/my/save/dir/checkpoint/000022100'.
  
      If specified, `checkpoint_path` is expected to contain the following
      files. (There can be additional shards for the `variables.data` files.)
         * `variables/variables.index`
         * `variables/variables.data-00000-of-00001`
  
      `load()` recreates a policy from the saved model, and if it was specified
      updates the policy from the checkpoint.  It returns the policy.
  
      Args:
        saved_model_path: string. Path to a directory containing a full saved model.
        checkpoint_path: string. Optional path to a directory containing a
          checkpoint of the model variables.
  
      Returns:
        A `tf_agents.policies.SavedModelPyTFEagerPolicy`.
      """
      policy = py_tf_eager_policy.SavedModelPyTFEagerPolicy(
          saved_model_path, load_specs_from_pbtxt=True
      )
      if checkpoint_path:
          policy.update_from_checkpoint(checkpoint_path)
      return policy
  
file_path: agents/tf_agents/policies/policy_loader.py
imports: import os
  from typing import Optional, Text
  import tensorflow.compat.v2
  from tf_agents.policies import policy_saver
  from tf_agents.policies import py_tf_eager_policy
label_desc: Use image node_id 1 for calling a global function with example usage: load(saved_model_path, checkpoint_path) and returns: policy