xnn.common.benchmark.report.apply_units#

xnn.common.benchmark.report.apply_units(rows, units)[source]#

Relabel row keys with their units, for unit-annotated file output.

Each key that has a unit becomes "key [unit]" (see _unit_label()), so writers emit the unit in the header / field names exactly as the printed table shows it. Rows without any unitful column are returned unchanged.

Parameters:
  • rows (list of dict) – Result rows with plain keys.

  • units (dict of str to str or None) – Physical unit per column.

Returns:

New rows with unit-annotated keys (order preserved), or rows unchanged when units is empty.

Return type:

list of dict