@@ -513,6 +513,7 @@ def forward(self, x):
513
513
# the ~2000 operators.
514
514
#
515
515
# .. code-block:: python
516
+ #
516
517
# def run_decompositions(
517
518
# self: ExportedProgram,
518
519
# decomposition_table: Optional[Dict[torch._ops.OperatorBase, Callable]]
@@ -646,18 +647,21 @@ def forward(self, x):
646
647
res = torch .compile (ep .module (), backend = "inductor" )(inp )
647
648
print (res )
648
649
649
- import torch ._export
650
- import torch ._inductor
651
-
652
- # Note: these APIs are subject to change
653
- # Compile the exported program to a .so using AOTInductor
654
- with torch .no_grad ():
655
- so_path = torch ._inductor .aot_compile (ep .module (), [inp ])
656
- # Load and run the .so file in Python.
657
- # To load and run it in a C++ environment, see:
658
- # https://pytorch.org/docs/main/torch.compiler_aot_inductor.html
659
- res = torch ._export .aot_load (so_path , device = "cuda" )(inp )
660
- print (res )
650
+ ######################################################################
651
+ # .. code-block:: python
652
+ #
653
+ # import torch._export
654
+ # import torch._inductor
655
+ #
656
+ # # Note: these APIs are subject to change
657
+ # # Compile the exported program to a .so using ``AOTInductor``
658
+ # with torch.no_grad():
659
+ # so_path = torch._inductor.aot_compile(ep.module(), [inp])
660
+ #
661
+ # # Load and run the .so file in Python.
662
+ # # To load and run it in a C++ environment, see:
663
+ # # https://pytorch.org/docs/main/torch.compiler_aot_inductor.html
664
+ # res = torch._export.aot_load(so_path, device="cuda")(inp)
661
665
662
666
######################################################################
663
667
# Conclusion
0 commit comments