code: def restore(self, directory=None, file=None):
          
          if file is None:
              file = tf.train.latest_checkpoint(
                  checkpoint_dir=(self.saver_directory if directory is None else directory),
                  # latest_filename=None  # Corresponds to argument of saver.save() in Model.save().
              )
          elif directory is None:
              file = os.path.join(self.saver_directory, file)
          elif not os.path.isfile(file):
              file = os.path.join(directory, file)
  
          # if not os.path.isfile(file):
          #     raise TensorForceError("Invalid model directory/file.")
  
          self.saver.restore(sess=self.session, save_path=file)
          self.session.run(fetches=self.list_buffer_index_reset_op)
docs: Restore TensorFlow model. If no checkpoint file is given, the latest checkpoint is
          restored. If no checkpoint directory is given, the model's default saver directory is
          used (unless file specifies the entire path).
  
          Args:
              directory: Optional checkpoint directory.
              file: Optional checkpoint file, or path if directory not given.