

def get_value_from_summary_string(tag, summary_str):
    ' get_value_from_summary_string.\n\n    Retrieve a summary value from a summary string.\n\n    Arguments:\n        tag: `str`. The summary tag (name).\n        summary_str: `str`. The summary string to look in.\n\n    Returns:\n        A `float`. The retrieved value.\n\n    Raises:\n        `Exception` if tag not found.\n\n    '
    summ = summary_pb2.Summary()
    summ.ParseFromString(summary_str)
    for row in summ.value:
        if (row.tag == tag):
            return float(row.simple_value)
    raise ValueError((('Tag: ' + tag) + ' cannot be found in summaries list.'))

dataset/ETHPy150Open tflearn/tflearn/tflearn/summaries.py get_value_from_summary_string/original