Home / Function/ main() — pytorch Function Reference

main() — pytorch Function Reference

Architecture documentation for the main() function in analyze_templates.py from the pytorch codebase.

Entity Profile

Dependency Diagram

graph TD
  fc92d87b_ad85_a501_c5b5_6e3bd9880812["main()"]
  551bcc43_5dd8_fe79_e16b_3b670a030d46["parse_log_file()"]
  fc92d87b_ad85_a501_c5b5_6e3bd9880812 -->|calls| 551bcc43_5dd8_fe79_e16b_3b670a030d46
  ba6f4aaa_2ca6_4636_6393_57fd7cfb55c1["optimize_templates()"]
  fc92d87b_ad85_a501_c5b5_6e3bd9880812 -->|calls| ba6f4aaa_2ca6_4636_6393_57fd7cfb55c1
  style fc92d87b_ad85_a501_c5b5_6e3bd9880812 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

benchmarks/dynamo/microbenchmarks/analyze_templates.py lines 205–216

def main(filename, min_templates, max_templates, verbose):
    occurrence_count, benchmark_logs = parse_log_file(filename)
    times = []
    for N in range(min_templates, max_templates + 1):
        selected_templates, total_time = optimize_templates(
            N, occurrence_count, benchmark_logs, verbose
        )
        print(f"N = {N}")
        print(f"Selected Templates: {selected_templates}")
        print(f"Total Weighted Time: {total_time}")
        times.append(total_time)
    print(times)

Subdomains

Frequently Asked Questions

What does main() do?
main() is a function in the pytorch codebase.
What does main() call?
main() calls 2 function(s): optimize_templates, parse_log_file.

Analyze Your Own Codebase

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

Try Supermodel Free