From 376c16703c7f55a7eab9d5751bfc0e91af26a735 Mon Sep 17 00:00:00 2001 From: Edward Yang Date: Tue, 24 Jun 2025 11:08:53 -0400 Subject: [PATCH] Document each of the private member variables on ExportedProgram (#156704) Authored with claude code and then reviewed by hand. If you don't like it, tell me. Signed-off-by: Edward Yang Pull Request resolved: https://github.com/pytorch/pytorch/pull/156704 Approved by: https://github.com/albanD, https://github.com/zhxchen17, https://github.com/jingsh --- torch/export/exported_program.py | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/torch/export/exported_program.py b/torch/export/exported_program.py index 00f775ce522..cb4b41b94ee 100644 --- a/torch/export/exported_program.py +++ b/torch/export/exported_program.py @@ -1011,6 +1011,30 @@ class ExportedProgram: again to construct a correct ExportedProgram. """ + _graph_module: torch.fx.GraphModule + """The underlying GraphModule containing the exported computation graph.""" + + _graph_signature: ExportGraphSignature + """The signature containing input/output specifications for the graph.""" + + _state_dict: dict[str, Any] + """Dictionary containing parameter and buffer values from the original module.""" + + _range_constraints: "dict[sympy.Symbol, ValueRanges]" + """Symbolic shape constraints for dynamic shapes in the graph.""" + + _module_call_graph: list[ModuleCallEntry] + """Call graph information tracking module hierarchy and signatures.""" + + _example_inputs: Optional[tuple[tuple[Any, ...], dict[str, Any]]] + """Example inputs used during export, stored as (args, kwargs) tuple.""" + + _constants: dict[str, _ConstantAttributeType] + """Dictionary of constant values used in the graph.""" + + _verifiers: list[type[Verifier]] + """List of verifier classes used to validate the exported program.""" + def __init__( self, root: Union[torch.nn.Module, dict[str, Any]],