Skip to content

Commit 3a4307c

Browse files
jackzhxngfacebook-github-bot
authored andcommitted
Fix pyre on builder.py
Differential Revision: D65837880
1 parent e332e2a commit 3a4307c

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

extension/llm/export/builder.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -184,8 +184,6 @@ def export(self) -> "LLMEdgeManager":
184184
if hasattr(self.args, "qnn") and self.args.qnn:
185185
# TODO: this is temporary and export_for_training doesn't work with qnn either. We need a
186186
# functional graph. See issue https://github.com/pytorch/executorch/pull/4627 for more details
187-
# pyre-fixme[8]: Attribute has type `Optional[GraphModule]`; used as
188-
# `Module`.
189187
exported_module = torch.export.export(
190188
self.model,
191189
self.example_inputs,
@@ -194,14 +192,14 @@ def export(self) -> "LLMEdgeManager":
194192
strict=True,
195193
)
196194
else:
197-
# pyre-fixme[8]: Attribute has type `Optional[GraphModule]`; used as
198-
# `Module`.
199195
exported_module = export_for_training(
200196
self.model,
201197
self.example_inputs,
202198
kwargs=self.example_kwarg_inputs,
203199
dynamic_shapes=dynamic_shape,
204200
)
201+
# pyre-fixme[8]: Attribute has type `Optional[GraphModule]`; used as
202+
# `Module`.
205203
self.pre_autograd_graph_module = exported_module.module()
206204
if hasattr(self.args, "export_only") and self.args.export_only:
207205
torch.export.save(exported_module, self.args.output_name)

0 commit comments

Comments
 (0)