Skip to content

Commit d8e9b26

Browse files
dbortfacebook-github-bot
authored andcommitted
Clarify that the python example isn't exactly the same (#1072)
Summary: Pull Request resolved: #1072 When reading this, "perform the same action" made it sound like these steps would also create an `add.pte` file, but that's not true. I looked into adding the code that would actually perform the exact same action, but the AddModule isn't in exir.tests. So, instead just call out that it's not literally the same action. While I'm here: - Remove the `>>>` so that users can copy and paste all of the lines at once - Remove the `print`, which just printed something like `<executorch.exir.program._program.ExirExportedProgram object at 0x102f1ae00>` Reviewed By: angelayi Differential Revision: D50578857 fbshipit-source-id: b0303b7c847572b33809781642680a16e8415eab
1 parent 2bbc792 commit d8e9b26

File tree

1 file changed

+8
-7
lines changed

1 file changed

+8
-7
lines changed

docs/source/getting-started-setup.md

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -179,16 +179,17 @@ To generate a sample program, complete the following steps:
179179
```
180180
:::
181181

182-
This command has created a `add.pte` file that contains your sample program.
182+
This command has created a `add.pte` file that contains your sample program,
183+
which adds its inputs multiple times.
183184

184-
Alternatively, you can use a Python Interpreter to perform the same action:
185+
Alternatively, you can use a Python interpreter to perform similar steps, this
186+
time creating a `mul.pte` program file that multiplies its inputs:
185187

186188
```python
187-
>>> import executorch.exir as exir
188-
>>> from executorch.exir.tests.models import Mul
189-
>>> m = Mul()
190-
>>> print(exir.capture(m, m.get_random_inputs()).to_edge())
191-
>>> open("mul.pte", "wb").write(exir.capture(m, m.get_random_inputs()).to_edge().to_executorch().buffer)
189+
import executorch.exir as exir
190+
from executorch.exir.tests.models import Mul
191+
m = Mul()
192+
open("mul.pte", "wb").write(exir.capture(m, m.get_random_inputs()).to_edge().to_executorch().buffer)
192193
```
193194

194195
In this step, you learned how you can export your PyTorch program to an ExecuTorch

0 commit comments

Comments
 (0)