class_docstr: Exposes a numpy API for saved_model policies in Eager mode.
class_docstr_tok: ["Exposes","a","numpy","API","for","saved_model","policies","in","Eager","mode","."]
docstr: Allows users to update saved_model variables directly from a checkpoint.
  
  `checkpoint_path` is a path that was passed to either `PolicySaver.save()`
  or `PolicySaver.save_checkpoint()`. The policy looks for set of checkpoint
  files with the file prefix `<checkpoint_path>/variables/variables'
  
  Args:
    checkpoint_path: Path to the checkpoint to restore and use to udpate this
      policy.
docstr_tok: ["Allows","users","to","update","saved_model","variables","directly","from","a","checkpoint",".","`","checkpoint_path","`","is","a","path","that","was","passed","to","either","`","PolicySaver.save","(",")","`","or","`","PolicySaver.save_checkpoint","(",")","`",".","The","policy","looks","for","set","of","checkpoint","files","with","the","file","prefix","`","<","checkpoint_path",">","\/variables\/variables'","Args",":","checkpoint_path",":","Path","to","the","checkpoint","to","restore","and","use","to","udpate","this","policy","."]
code: def update_from_checkpoint(self, checkpoint_path: Text):
      """Allows users to update saved_model variables directly from a checkpoint.
  
      `checkpoint_path` is a path that was passed to either `PolicySaver.save()`
      or `PolicySaver.save_checkpoint()`. The policy looks for set of checkpoint
      files with the file prefix `<checkpoint_path>/variables/variables'
  
      Args:
        checkpoint_path: Path to the checkpoint to restore and use to udpate this
          policy.
      """
      file_prefix = os.path.join(
          checkpoint_path,
          tf.saved_model.VARIABLES_DIRECTORY,
          tf.saved_model.VARIABLES_FILENAME,
      )
      status = self._checkpoint.read(file_prefix)
      # Checkpoints are assumed to have the format
      # <PATH>/<TO>/policy_checkpoint_xxxx where xxxx is the train step for that
      # checkpoint. We split based on '_' and take the last item which gives us
      # the train step.
      try:
          self._train_step_from_last_restored_checkpoint_path = int(
              checkpoint_path.split("_")[-1]
          )
      except ValueError:
          # In case the checkpoint format is not as expected.
          self._train_step_from_last_restored_checkpoint_path = None
      logging.info(
          "Checkpoint path: %s, train step: %s",
          checkpoint_path,
          self._train_step_from_last_restored_checkpoint_path,
      )
      # Check that all the variables in the policy were updated, but allow the
      # checkpoint to have additional variables. This helps sharing checkpoints
      # across policies.
      status.assert_existing_objects_matched().expect_partial()
  
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  import os
  from typing import Optional, Text
  from absl import logging
  import gin
  import tensorflow
  from tf_agents.policies import policy_saver
  from tf_agents.policies import py_policy
  from tf_agents.policies import tf_policy
  from tf_agents.specs import tensor_spec
  from tf_agents.trajectories import time_step
  from tf_agents.typing import types
  from tf_agents.utils import common
  from tf_agents.utils import nest_utils
label_desc: Use image node_id 6 for calling the SavedModelPyTFEagerPolicy obj's underlying member method code with example usage: obj.update_from_checkpoint(checkpoint_path) without return types