content/test/gpu/gpu_tests/ipg_utils.py
def _CalculateSummaryStatistics(metrics):
    """Calculates summary statistics for the given metrics.

    Args:
      metrics: A dictionary mapping metrics to lists of data points.

    Returns:
      A dictionary mapping the same metrics in |metrics| to dicts containing
      the 'mean' and 'stdev' for the metric.
    """
    summary = {}
    for key, data in metrics.items():
      assert data and len(data) > 1
      n = len(data)
      if outliers > 0:
        assert outliers * 2 < n
        data.sort()
        data = data[outliers:(n - outliers)]
        n = len(data)
      logging.debug('%s: valid samples = %d', key, n)
      mean = sum(data) / float(n)
      ss = sum((x - mean)**2 for x in data)
      stdev = (ss / float(n))**0.5
      summary[key] = {
          'mean': mean,
          'stdev': stdev,
      }
    return summary
Calculates summary statistics for the given metrics.

    Args:
      metrics: A dictionary mapping metrics to lists of data points.

    Returns:
      A dictionary mapping the same metrics in |metrics| to dicts containing
      the 'mean' and 'stdev' for the metric.
    
Calculates summary statistics for the given metrics.
Calculates summary statistics for the given metrics .
def _CalculateSummaryStatistics(metrics):
    summary = {}
    for key, data in metrics.items():
      assert data and len(data) > 1
      n = len(data)
      if outliers > 0:
        assert outliers * 2 < n
        data.sort()
        data = data[outliers:(n - outliers)]
        n = len(data)
      logging.debug('%s: valid samples = %d', key, n)
      mean = sum(data) / float(n)
      ss = sum((x - mean)**2 for x in data)
      stdev = (ss / float(n))**0.5
      summary[key] = {
          'mean': mean,
          'stdev': stdev,
      }
    return summary
def _CalculateSummaryStatistics ( metrics ) : summary = { } for key , data in metrics . items ( ) : assert data and len ( data ) > 1 n = len ( data ) if outliers > 0 : assert outliers * 2 < n data . sort ( ) data = data [ outliers : ( n - outliers ) ] n = len ( data ) logging . debug ( '%s: valid samples = %d' , key , n ) mean = sum ( data ) / float ( n ) ss = sum ( ( x - mean ) ** 2 for x in data ) stdev = ( ss / float ( n ) ) ** 0.5 summary [ key ] = { 'mean' : mean , 'stdev' : stdev , } return summary
Calculates summary statistics for the given metrics.
Calculates summary statistics for the given metrics .
"""Calculates summary statistics for the given metrics.

    Args:
      metrics: A dictionary mapping metrics to lists of data points.

    Returns:
      A dictionary mapping the same metrics in |metrics| to dicts containing
      the 'mean' and 'stdev' for the metric.
    """
A dictionary mapping the same metrics in |metrics| to dicts containing
the 'mean' and 'stdev' for the metric.
A dictionary mapping the same metrics in |metrics| to dicts containing the ' mean ' and ' stdev ' for the metric .
metrics
A dictionary mapping metrics to lists of data points.
A dictionary mapping metrics to lists of data points .