Skip to content

Commit f90b15b

Browse files
JacobSzwejbkafacebook-github-bot
authored andcommitted
add exir-api-reference.rst (#457)
Summary: Pull Request resolved: #457 Reviewed By: svekars, angelayi Differential Revision: D49551799
1 parent 7ed7479 commit f90b15b

File tree

3 files changed

+34
-10
lines changed

3 files changed

+34
-10
lines changed
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
Export to ExecuTorch API Reference
2+
-------------
3+
4+
.. automodule:: exir
5+
.. autofunction:: to_edge
6+
7+
.. autoclass:: EdgeProgramManager
8+
:members: methods, config_methods, exported_program, transform, to_backend, to_executorch
9+
10+
.. autoclass:: ExecutorchProgramManager
11+
:members: methods, config_methods, exported_program, buffer, debug_handle_map, dump_executorch_program
12+
13+
.. automodule:: exir.backend.backend_api
14+
.. autofunction:: to_backend
15+
16+
.. autoclass:: LoweredBackendModule
17+
:members: backend_id, processed_bytes, compile_specs, original_module, buffer, program

docs/source/index.rst

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,14 @@ Topics in this section will help you get started with ExecuTorch.
9393

9494
export-overview
9595

96+
.. toctree::
97+
:glob:
98+
:maxdepth: 1
99+
:caption: API Reference
100+
:hidden:
101+
102+
export-to-executorch-api-reference
103+
96104
.. toctree::
97105
:glob:
98106
:maxdepth: 1

exir/program/_program.py

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -567,19 +567,18 @@ def to_edge(
567567
compile_config: Optional[EdgeCompileConfig] = None,
568568
) -> "EdgeProgramManager":
569569
"""
570-
Constructs an EdgeProgramManger from a set of exported programs in
571-
aten dialect. Upon construction those programs are transformed into edge dialect.
570+
:func:`to_edge` constructs an EdgeProgramManger from a set of exported programs in
571+
ATen dialect. Upon construction those programs are transformed into edge dialect.
572572
573573
Args:
574-
Can be a single ExportedProgram or a dictionary mapping function names
575-
to their corresponding ExportedPrograms. If only a single ExportedProgram is provided
576-
it will be assigned the name "forward".
574+
programs: Can be a single ExportedProgram or a dictionary mapping function names to their corresponding ExportedPrograms. If only a single ExportedProgram is provided it will be assigned the name "forward".
577575
578-
constant_methods: An optional dictionary of method name to the constant value returned
579-
by that method in eager mode. Often used to store config information on Edge models.
576+
constant_methods: An optional dictionary of method name to the constant value returned by that method in eager mode. Often used to store config information on Edge models.
580577
581-
compile_config: An optional argument used to provide greater control over
582-
the transformation to edge dialect process.
578+
compile_config: An optional argument used to provide greater control over the transformation to edge dialect process.
579+
580+
Returns:
581+
EdgeProgramManager
583582
"""
584583
config = compile_config or EdgeCompileConfig()
585584
if not isinstance(programs, dict):
@@ -593,7 +592,7 @@ def to_edge(
593592
try:
594593
EXIRATenDialectVerifier()(program.graph_module)
595594
except ExportError as e:
596-
logging.info(f"Input program {name} is not in aten dialect.")
595+
logging.info(f"Input program {name} is not in ATen dialect.")
597596
raise e
598597

599598
op_replace_pass = [OpReplacePass()] if config._use_edge_ops else []

0 commit comments

Comments
 (0)