MCPcopy Create free account
hub / github.com/NVIDIA/TensorRT / str_output_stats

Function str_output_stats

tools/Polygraphy/polygraphy/comparator/util.py:140–154  ·  view source on GitHub ↗
(output, runner_name=None)

Source from the content-addressed store, hash-verified

138
139
140def str_output_stats(output, runner_name=None):
141 ret = ""
142 if runner_name:
143 ret += f"{runner_name} | Stats: "
144
145 try:
146 with np.testing.suppress_warnings() as sup:
147 sup.filter(RuntimeWarning)
148 ret += f"mean={compute_mean(output):.5g}, std-dev={compute_stddev(output):.5g}, var={compute_variance(output):.5g}, median={compute_median(output):.5g}, min={compute_min(output):.5g} at {compute_argmin(output)}, max={compute_max(output):.5g} at {compute_argmax(output)}, avg-magnitude={compute_average_magnitude(output):.5g}\n"
149 except Exception as err:
150 G_LOGGER.verbose(f"Could not generate statistics.\nNote: Error was: {err}")
151 ret += "<Error while computing statistics>"
152 if config.INTERNAL_CORRECTNESS_CHECKS:
153 raise
154 return ret
155
156
157def log_output_stats(output, info_hist=False, runner_name=None, hist_range=None):

Callers 1

log_output_statsFunction · 0.85

Calls 10

compute_meanFunction · 0.85
compute_stddevFunction · 0.85
compute_varianceFunction · 0.85
compute_medianFunction · 0.85
compute_minFunction · 0.85
compute_argminFunction · 0.85
compute_maxFunction · 0.85
compute_argmaxFunction · 0.85
verboseMethod · 0.45

Tested by

no test coverage detected