latest (dev)
Copy
Latest development documentation · Updated 2026-10-08
ExportedProgram
- class tensorplay.export.ExportedProgram(graph_module: GraphModule, graph_signature: ExportGraphSignature | GraphSignature, example_inputs: dict[str, ~typing.Any]=<factory>, dynamic_shapes: Any = None, module_call_graph: list[ModuleCallEntry] = <factory>, range_constraints: dict[~typing.Any, ~typing.Any]=<factory>, equality_constraints: list[EqualityConstraint] = <factory>, verifier: Any = None)[source]
A validated graph together with its state and example bindings.
- static call_exported(program: ExportedProgram) Callable[[...], Any][source]
Return a callable executing the flat contract on user arguments.
- property code: str
Python source of the captured graph’s generated forward.
- classmethod deserialize(artifact: Any, state_dict: Any = None, constants: Any = None, example_inputs: Any = None) ExportedProgram[source]
Rebuild a program from
serialize()artifacts.
- module() GraphModule[source]
Return a self-contained module with lifted state folded back in.
The returned module takes only the user arguments: state placeholders are rewritten into attribute reads on a fresh module that owns the parameter, buffer, and constant values. The result is cached; pass
rebindto drop state changes made through this program view.
- run_decompositions(decomp_table: Any = None) ExportedProgram[source]
Return a copied program after applying registered graph rewrites.
Entries map a graph target (a callable, a method name, or a target string) to a builder invoked as
builder(graph, node); the builder creates the replacement nodes and returns the value users should consume. Nodes whose target has no entry are left untouched.
Help improve this page
Found an error, an unclear step, or a missing example?

