Skip to content

Commit d2fb052

Browse files
Update base for Update on "[ExecuTorch][#10447] Extend PyBundledModule with extension.BundledModule"
#10447 # Context This issue is a step of #9638. In #9638, we want to have `extension.Module` as the single source of implementation in `pybindings`, which means that `pybindings.PyModule` should use `extension.Module` rather than its own `pybindings.Module`. # Proposal Now that we have `extension.BundledModule` ready, we want to test it out by having our existing `PyBundledModule` to extend it, and let `verify_result_with_bundled_expected_output` to use it, so that we can test out the whole thing with https://github.com/pytorch/executorch/blob/fb45e19055a92d2a91a4d4b7008e135232cbb14b/devtools/bundled_program/test/test_end2end.py Differential Revision: [D73564127](https://our.internmc.facebook.com/intern/diff/D73564127/) [ghstack-poisoned]
1 parent 3526512 commit d2fb052

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

extension/module/test/resources/gen_bundled_program.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
from executorch.exir import to_edge_transform_and_lower
1111
from torch.export import export, export_for_training
1212

13+
1314
# Step 1: ExecuTorch Program Export
1415
class SampleModel(torch.nn.Module):
1516
"""An example model with multi-methods. Each method has multiple input and single output"""
@@ -27,6 +28,7 @@ def forward(self, x: torch.Tensor, q: torch.Tensor) -> torch.Tensor:
2728
torch.add(y, q, out=y)
2829
return y
2930

31+
3032
def main() -> None:
3133
"""Sample code to generate bundled program and save it to file. It is the same as in https://pytorch.org/executorch/0.6/bundled-io.html#emit-example"""
3234
# Inference method name of SampleModel we want to bundle testcases to.
@@ -46,7 +48,6 @@ def main() -> None:
4648
capture_input,
4749
)
4850

49-
5051
# Emit the traced method into ET Program.
5152
et_program = to_edge_transform_and_lower(method_graph).to_executorch()
5253

0 commit comments

Comments
 (0)