tools/perf/cli_tools/tbmv3/validators/utils.py
def AssertHistogramStatsAlmostEqual(test_ctx, v2_hist, v3_hist, precision=1e-3):
  """Asserts major histogram statistics are close enough.

  sum, mean, max, min are asserted to be within 3 decimal places.
  count is asserted to be exactly equal."""
  v2_running = v2_hist.running
  v3_running = v3_hist.running
  test_ctx.assertAlmostEqual(v2_running.mean, v3_running.mean, delta=precision)
  test_ctx.assertAlmostEqual(v2_running.sum, v3_running.sum, delta=precision)
  test_ctx.assertAlmostEqual(v2_running.max, v3_running.max, delta=precision)
  test_ctx.assertAlmostEqual(v2_running.min, v3_running.min, delta=precision)
  test_ctx.assertEqual(v2_running.count, v3_running.count)
Asserts major histogram statistics are close enough.

  sum, mean, max, min are asserted to be within 3 decimal places.
  count is asserted to be exactly equal.
Asserts major histogram statistics are close enough.
sum, mean, max, min are asserted to be within 3 decimal places.
count is asserted to be exactly equal.
Asserts major histogram statistics are close enough . sum mean max min are asserted to be within 3 decimal places . count is asserted to be exactly equal .
def AssertHistogramStatsAlmostEqual(test_ctx, v2_hist, v3_hist, precision=1e-3):
  v2_running = v2_hist.running
  v3_running = v3_hist.running
  test_ctx.assertAlmostEqual(v2_running.mean, v3_running.mean, delta=precision)
  test_ctx.assertAlmostEqual(v2_running.sum, v3_running.sum, delta=precision)
  test_ctx.assertAlmostEqual(v2_running.max, v3_running.max, delta=precision)
  test_ctx.assertAlmostEqual(v2_running.min, v3_running.min, delta=precision)
  test_ctx.assertEqual(v2_running.count, v3_running.count)
def AssertHistogramStatsAlmostEqual ( test_ctx , v2_hist , v3_hist , precision = 1e-3 ) : v2_running = v2_hist . running v3_running = v3_hist . running test_ctx . assertAlmostEqual ( v2_running . mean , v3_running . mean , delta = precision ) test_ctx . assertAlmostEqual ( v2_running . sum , v3_running . sum , delta = precision ) test_ctx . assertAlmostEqual ( v2_running . max , v3_running . max , delta = precision ) test_ctx . assertAlmostEqual ( v2_running . min , v3_running . min , delta = precision ) test_ctx . assertEqual ( v2_running . count , v3_running . count )
Asserts major histogram statistics are close enough.
Asserts major histogram statistics are close enough .
"""Asserts major histogram statistics are close enough.

  sum, mean, max, min are asserted to be within 3 decimal places.
  count is asserted to be exactly equal."""
test_ctx
v2_hist
v3_hist
precision