Skip to content

Commit 71dd61c

Browse files
committed
Update on "tutorial for devtool debugibility"
Differential Revision: [D90809255](https://our.internmc.facebook.com/intern/diff/D90809255/) [ghstack-poisoned]
2 parents 0125836 + 6ef0ebf commit 71dd61c

1 file changed

Lines changed: 33 additions & 31 deletions

File tree

docs/source/tutorials_source/devtools-debugging-tutorial.py

Lines changed: 33 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -312,37 +312,39 @@
312312
# For the CMake pipeline, we create a ``BundledProgram`` that packages the model
313313
# with sample inputs and expected outputs for testing. We reuse the
314314
# ``et_program_manager`` from Step 1.
315-
316-
from executorch.devtools import BundledProgram
317-
318-
from executorch.devtools.bundled_program.config import MethodTestCase, MethodTestSuite
319-
from executorch.devtools.bundled_program.serialize import (
320-
serialize_from_bundled_program_to_flatbuffer,
321-
)
322-
323-
# Construct Method Test Suites using the same model and inputs from Pipeline 1
324-
m_name = "forward"
325-
inputs = [model_inputs for _ in range(2)]
326-
327-
method_test_suites = [
328-
MethodTestSuite(
329-
method_name=m_name,
330-
test_cases=[
331-
MethodTestCase(inputs=inp, expected_outputs=model(*inp)) for inp in inputs
332-
],
333-
)
334-
]
335-
336-
# Generate BundledProgram using the existing et_program_manager
337-
bundled_program = BundledProgram(et_program_manager, method_test_suites)
338-
339-
# Serialize BundledProgram to flatbuffer
340-
serialized_bundled_program = serialize_from_bundled_program_to_flatbuffer(
341-
bundled_program
342-
)
343-
bundled_program_path = os.path.join(temp_dir, "bundled_program.bp")
344-
with open(bundled_program_path, "wb") as f:
345-
f.write(serialized_bundled_program)
315+
#
316+
# .. code-block:: python
317+
#
318+
# from executorch.devtools import BundledProgram
319+
# from executorch.devtools.bundled_program.config import MethodTestCase, MethodTestSuite
320+
# from executorch.devtools.bundled_program.serialize import (
321+
# serialize_from_bundled_program_to_flatbuffer,
322+
# )
323+
#
324+
# # Construct Method Test Suites using the same model and inputs from Pipeline 1
325+
# m_name = "forward"
326+
# inputs = [model_inputs for _ in range(2)]
327+
#
328+
# method_test_suites = [
329+
# MethodTestSuite(
330+
# method_name=m_name,
331+
# test_cases=[
332+
# MethodTestCase(inputs=inp, expected_outputs=model(*inp)) for inp in inputs
333+
# ],
334+
# )
335+
# ]
336+
#
337+
# # Generate BundledProgram using the existing et_program_manager
338+
# bundled_program = BundledProgram(et_program_manager, method_test_suites)
339+
#
340+
# # Serialize BundledProgram to flatbuffer
341+
# serialized_bundled_program = serialize_from_bundled_program_to_flatbuffer(
342+
# bundled_program
343+
# )
344+
# bundled_program_path = os.path.join(temp_dir, "bundled_program.bp")
345+
# with open(bundled_program_path, "wb") as f:
346+
# f.write(serialized_bundled_program)
347+
#
346348

347349
######################################################################
348350
# Step 3: Run with CMake Example Runner

0 commit comments

Comments
 (0)