Skip to content

Commit 05c08f2

Browse files
Small typo in torch.compile tutorial (#3806)
Fixes #3804 ## Description There is a small inconsistency in the section explaining the behavior of torch.compile when running the function bar. When describing the first run, the traced graph is listed as `x = a / (torch.abs(a) + 1); b.sum()` but when referencing that same graph (from the first run) in the second run it is listed as `x = a / (torch.abs(a) + 1);` ## Checklist <!--- Make sure to add `x` to all items in the following checklist: --> - [x] The issue that is being fixed is referred in the description (see above "Fixes #ISSUE_NUMBER") - [x] Only one issue is addressed in this pull request - [x] Labels from the issue that this PR is fixing are added to this pull request - [x] No unnecessary issues are included into this pull request. cc @williamwen42 @msaroufim @anijain2305 @angelayi Co-authored-by: sekyondaMeta <127536312+sekyondaMeta@users.noreply.github.com>
1 parent 084b358 commit 05c08f2

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

intermediate_source/torch_compile_tutorial.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -330,7 +330,7 @@ def bar(a, b):
330330
#
331331
# The second time we run ``bar``, we take the other branch of the if statement
332332
# and we get 1 traced graph corresponding to the code ``b = b * -1; return x * b``.
333-
# We do not see a graph of ``x = a / (torch.abs(a) + 1)`` outputted the second time
333+
# We do not see a graph of ``x = a / (torch.abs(a) + 1); b.sum()`` outputted the second time
334334
# since ``torch.compile`` cached this graph from the first run and re-used it.
335335
#
336336
# Let's investigate by example how TorchDynamo would step through ``bar``.

0 commit comments

Comments
 (0)