Computes a list of api_pb2.HParamInfo from the current run, tag info.

    Finds all the SessionStartInfo messages and collects the hparams values
    appearing in each one. For each hparam attempts to deduce a type that fits
    all its values. Finally, sets the 'domain' of the resulting HParamInfo
    to be discrete if the type is string and the number of distinct values is
    small enough.

    Returns:
      A list of api_pb2.HParamInfo messages.

def _compute_hparam_infos(self):
    """Computes a list of api_pb2.HParamInfo from the current run, tag info.

    Finds all the SessionStartInfo messages and collects the hparams values
    appearing in each one. For each hparam attempts to deduce a type that fits
    all its values. Finally, sets the 'domain' of the resulting HParamInfo
    to be discrete if the type is string and the number of distinct values is
    small enough.

    Returns:
      A list of api_pb2.HParamInfo messages.
    """
    run_to_tag_to_content = self.multiplexer.PluginRunToTagToContent(
        metadata.PLUGIN_NAME)
    # Construct a dict mapping an hparam name to its list of values.
    hparams = collections.defaultdict(list)
    for tag_to_content in run_to_tag_to_content.values():
      if metadata.SESSION_START_INFO_TAG not in tag_to_content:
        continue
      start_info = metadata.parse_session_start_info_plugin_data(
          tag_to_content[metadata.SESSION_START_INFO_TAG])
      for (name, value) in six.iteritems(start_info.hparams):
        hparams[name].append(value)

    # Try to construct an HParamInfo for each hparam from its name and list
    # of values.
    result = []
    for (name, values) in six.iteritems(hparams):
      hparam_info = self._compute_hparam_info_from_values(name, values)
      if hparam_info is not None:
        result.append(hparam_info)
    return result