Skip to content

Commit afb95a7

Browse files
tarun292mergennachin
authored andcommitted
Simplify bundled program example comment (#927)
Summary: ^ Pull Request resolved: #927 Test Plan: CI Reviewed By: Jack-Khuu Differential Revision: D50303044 Pulled By: tarun292 fbshipit-source-id: ecf74d7cb74ef9f8267fc1435948b9f938243616
1 parent dbb13fa commit afb95a7

File tree

2 files changed

+8
-9
lines changed

2 files changed

+8
-9
lines changed

docs/source/tutorials_source/sdk-integration-tutorial.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -86,12 +86,12 @@
8686
aten_model, compile_config=EdgeCompileConfig(_check_ir_validity=True)
8787
)
8888
edge_program_manager_copy = copy.deepcopy(edge_program_manager)
89-
et_program_manager: ExecutorchProgramManager = edge_program_manager_copy.to_executorch()
89+
et_program_manager: ExecutorchProgramManager = edge_program_manager.to_executorch()
9090

9191

9292
# Generate ETRecord
9393
etrecord_path = "etrecord.bin"
94-
generate_etrecord(etrecord_path, edge_program_manager, et_program_manager)
94+
generate_etrecord(etrecord_path, edge_program_manager_copy, et_program_manager)
9595

9696
# sphinx_gallery_start_ignore
9797
from unittest.mock import patch

examples/sdk/scripts/export_bundled_program.py

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -84,13 +84,12 @@ def export_to_bundled_program(
8484
print("Creating bundled test cases...")
8585
method_names = [method.name for method in program.execution_plan]
8686

87-
# Just as an example to show how multiple input sets can be bundled along to all methods. Here we
88-
# create a list called bundled_inputs, every element of which contains all test infos for the method
89-
# sharing same index in the method_names forwarded to BundledConfig against which it will be tested.
90-
# Each element is a list with the example_inputs tuple used twice. Each instance of example_inputs
91-
# is a MethodInputType (Tuple[Union[torch.tenor, int, bool, float]]), which represents one test
92-
# set for the method.
93-
bundled_inputs = [[example_inputs, example_inputs] for _ in program.execution_plan]
87+
# A model could have multiple entry point methods and each of them can have inputs bundled for testing.
88+
# This example demonstrates a model which has a single entry point method ("forward") to which we want
89+
# to bundle two input test cases (example_inputs is used two times) for the "forward" method.
90+
bundled_inputs = [
91+
[example_inputs, example_inputs] for i in range(len(method_names))
92+
]
9493

9594
bundled_expected_outputs = [
9695
[[getattr(model, method_names[i])(*x)] for x in bundled_inputs[i]]

0 commit comments

Comments
 (0)