File tree Expand file tree Collapse file tree 1 file changed +6
-2
lines changed Expand file tree Collapse file tree 1 file changed +6
-2
lines changed Original file line number Diff line number Diff line change 88
88
89
89
# min=2 is not a bug and is explained in the 0/1 Specialization Problem
90
90
batch_dim = torch .export .Dim ("batch" , min = 2 , max = 32 )
91
- so_path = torch ._export . aot_compile (
91
+ exported_program = torch .export . export (
92
92
model ,
93
93
example_inputs ,
94
94
# Specify the first dimension of the input x as dynamic
95
95
dynamic_shapes = {"x" : {0 : batch_dim }},
96
+ )
97
+ so_path = torch ._inductor .aot_compile (
98
+ exported_program .module (),
99
+ example_inputs ,
96
100
# Specify the generated shared library path
97
101
options = aot_compile_options
98
102
)
@@ -211,7 +215,7 @@ def timed(fn):
211
215
# Conclusion
212
216
# ----------
213
217
#
214
- # In this tutorial , we have learned how to effectively use the AOTInductor for Python runtime by
218
+ # In this recipe , we have learned how to effectively use the AOTInductor for Python runtime by
215
219
# compiling and loading a pretrained ``ResNet18`` model using the ``torch._export.aot_compile``
216
220
# and ``torch._export.aot_load`` APIs. This process demonstrates the practical application of
217
221
# generating a shared library and running it within a Python environment, even with dynamic shape
You can’t perform that action at this time.
0 commit comments