Home / Function/ print_summary_table() — pytorch Function Reference

print_summary_table() — pytorch Function Reference

Architecture documentation for the print_summary_table() function in common.py from the pytorch codebase.

Entity Profile

Dependency Diagram

graph TD
  621801d2_c814_c83d_5fe1_d5605ee2a2fc["print_summary_table()"]
  bf029f88_db70_e8df_06de_66d5b0f31c56["print_summary()"]
  bf029f88_db70_e8df_06de_66d5b0f31c56 -->|calls| 621801d2_c814_c83d_5fe1_d5605ee2a2fc
  style 621801d2_c814_c83d_5fe1_d5605ee2a2fc fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

benchmarks/dynamo/common.py lines 620–649

def print_summary_table(data, print_dataframe=False):
    if print_dataframe:
        pd.options.display.max_rows = 1000
        pd.options.display.max_columns = 1000
        pd.options.display.width = 2000
        print(data)
    width = max(map(len, data.columns))
    for col in data.columns:
        try:
            if col in ("dev", "name", "batch_size", "tag"):
                continue
            elif col in ("pct_ops", "pct_time"):
                print(col.ljust(width), f"{data[col].mean():.3%}")
            elif col in ("graphs", "graph_calls", "captured_ops", "total_ops"):
                print(col.ljust(width), f"{data[col].mean():.3f}")
            elif col in ("compilation_latency"):
                print(col.ljust(width), f"mean={data[col].mean():.3f} seconds")
            elif col in ("compression_ratio"):
                print(col.ljust(width), f"mean={data[col].mean():.3f}x")
            elif col in ("accuracy"):
                pass_rate = (data[col] == "pass").mean()
                print(col.ljust(width), f"pass_rate={100 * pass_rate:.2f}%")
            else:
                cdata = data[col]
                print(
                    col.ljust(width),
                    f"gmean={gmean(cdata):.2f}x mean={cdata.mean():.3f}x",
                )
        except Exception:
            pass

Subdomains

Called By

Frequently Asked Questions

What does print_summary_table() do?
print_summary_table() is a function in the pytorch codebase.
What calls print_summary_table()?
print_summary_table() is called by 1 function(s): print_summary.

Analyze Your Own Codebase

Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.

Try Supermodel Free