code: def load_config(logdir):
    # pylint: disable=missing-raises-doc
    
    config_path = logdir and os.path.join(logdir, 'config.yaml')
    if not config_path or not tf.gfile.Exists(config_path):
      message = (
          'Cannot resume an existing run since the logging directory does not '
          'contain a configuration file.')
      raise IOError(message)
    with tf.gfile.FastGFile(config_path, 'r') as file_:
      config = yaml.load(file_, Loader=yaml.Loader)
    message = 'Resume run and write summaries and checkpoints to {}.'
    tf.logging.info(message.format(config.logdir))
    return config
docs: Load a configuration from the log directory.
  
    Args:
      logdir: The logging directory containing the configuration file.
  
    Raises:
      IOError: The logging directory does not contain a configuration file.
  
    Returns:
      Configuration object.