class_docstr: An implementation of the DQN agent.
class_docstr_tok: ["An","implementation","of","the","DQN","agent","."]
docstr: Returns a self-contained bundle of the agent's state.
  
  This is used for checkpointing. It will return a dictionary containing all
  non-TensorFlow objects (to be saved into a file by the caller), and it saves
  all TensorFlow objects into a checkpoint file.
  
  Args:
    checkpoint_dir: str, directory where TensorFlow objects will be saved.
    iteration_number: int, iteration number to use for naming the checkpoint
      file.
  
  Returns:
    A dict containing additional Python objects to be checkpointed by the
      experiment. If the checkpoint directory does not exist, returns None.
docstr_tok: ["Returns","a","self-contained","bundle","of","the","agent","'s","state",".","This","is","used","for","checkpointing",".","It","will","return","a","dictionary","containing","all","non-TensorFlow","objects","(","to","be","saved","into","a","file","by","the","caller",")",",","and","it","saves","all","TensorFlow","objects","into","a","checkpoint","file",".","Args",":","checkpoint_dir",":","str",",","directory","where","TensorFlow","objects","will","be","saved",".","iteration_number",":","int",",","iteration","number","to","use","for","naming","the","checkpoint","file",".","Returns",":","A","dict","containing","additional","Python","objects","to","be","checkpointed","by","the","experiment",".","If","the","checkpoint","directory","does","not","exist",",","returns","None","."]
code: def bundle_and_checkpoint(self, checkpoint_dir, iteration_number):
      """Returns a self-contained bundle of the agent's state.
  
      This is used for checkpointing. It will return a dictionary containing all
      non-TensorFlow objects (to be saved into a file by the caller), and it saves
      all TensorFlow objects into a checkpoint file.
  
      Args:
        checkpoint_dir: str, directory where TensorFlow objects will be saved.
        iteration_number: int, iteration number to use for naming the checkpoint
          file.
  
      Returns:
        A dict containing additional Python objects to be checkpointed by the
          experiment. If the checkpoint directory does not exist, returns None.
      """
      if not tf.io.gfile.exists(checkpoint_dir):
          return None
      # Call the Tensorflow saver to checkpoint the graph.
      self._saver.save(
          self._sess,
          os.path.join(checkpoint_dir, "tf_ckpt"),
          global_step=iteration_number,
      )
      # Checkpoint the out-of-graph replay buffer.
      self._replay.save(checkpoint_dir, iteration_number)
      bundle_dictionary = {}
      bundle_dictionary["state"] = self.state
      bundle_dictionary["training_steps"] = self.training_steps
      return bundle_dictionary
  
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  import math
  import os
  import random
  from absl import logging
  from dopamine.discrete_domains import atari_lib
  from dopamine.replay_memory import circular_replay_buffer
  import gin.tf
  import numpy
  import tensorflow
label_desc: Use image node_id 16 for calling the DQNAgent obj's underlying member method code with example usage: obj.bundle_and_checkpoint(checkpoint_dir, iteration_number) and returns: bundle_dictionary, None