Home / Function/ main() — pytorch Function Reference

main() — pytorch Function Reference

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

Entity Profile

Dependency Diagram

graph TD
  f822d809_a1bb_d705_8dc6_19fbccf81fbe["main()"]
  23307c71_699b_103c_3462_4f7a39e4d8a7["huge_graph()"]
  f822d809_a1bb_d705_8dc6_19fbccf81fbe -->|calls| 23307c71_699b_103c_3462_4f7a39e4d8a7
  style f822d809_a1bb_d705_8dc6_19fbccf81fbe fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

benchmarks/dynamo/microbenchmarks/cache_debug_microbenchmarks.py lines 20–28

def main():
    g = huge_graph()
    details = FxGraphHashDetails(g, [], {}, [])

    def fn():
        return details.debug_lines()

    t = min(timeit.repeat(fn, number=K, repeat=3))
    print(f"iterating over {N * K} FX nodes took {t:.1f}s ({N * K / t:.0f} nodes/s)")

Subdomains

Calls

Frequently Asked Questions

What does main() do?
main() is a function in the pytorch codebase.
What does main() call?
main() calls 1 function(s): huge_graph.

Analyze Your Own Codebase

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

Try Supermodel Free