def _run_dict(session, run_dict, feed_dict=None):
  """Convenience function to run a session on each item in a dict of tensors.

  Args:
    session: The session to evaluate.
    run_dict: A dict of tensors to be run in the session.
    feed_dict: Feed dict to be used in running the session.
  Returns:
    A dict containing the result of evaluating the tensors.
  Raises:
    ValueError: if `run_dict` is missing or empty.
  """
  if run_dict is None:
    raise ValueError('Invalid run_dict %s.', run_dict)
  keys = run_dict.keys()
  values = session.run([run_dict[key] for key in keys], feed_dict=feed_dict)
  return dict(zip(keys, values))