diff --git a/intermediate_source/torch_compile_tutorial.py b/intermediate_source/torch_compile_tutorial.py index 343ad3b21b..75fab8c3f3 100644 --- a/intermediate_source/torch_compile_tutorial.py +++ b/intermediate_source/torch_compile_tutorial.py @@ -27,7 +27,7 @@ # # For an end-to-end example on a real model, check out our `end-to-end torch.compile tutorial `__. # -# To troubleshoot issues and to gain a deeper understanding of how to apply ``torch.compile`` to your code, check out `the torch.compile programming model `__. +# To troubleshoot issues and to gain a deeper understanding of how to apply ``torch.compile`` to your code, check out `the torch.compile programming model `__. # # **Contents** # @@ -379,7 +379,7 @@ def false_branch(y): # NOTE: torch.cond doesn't allow aliased outputs return y.clone() - x = cond(b.sum() < 0, true_branch, false_branch, (b,)) + b = cond(b.sum() < 0, true_branch, false_branch, (b,)) return x * b @@ -394,7 +394,7 @@ def false_branch(y): # `the torch.export tutorial `__ # for more details on ``torch.export``. # -# Check out our `section on graph breaks in the torch.compile programming model `__ +# Check out our `section on graph breaks in the torch.compile programming model `__ # for tips on how to work around graph breaks. ###################################################################### @@ -405,7 +405,7 @@ def false_branch(y): # Are you looking for tips on how to best use ``torch.compile``? # Or maybe you simply want to learn more about the inner workings of ``torch.compile``? # -# Check out `the torch.compile programming model `__. +# Check out `the torch.compile programming model `__. ###################################################################### # Conclusion @@ -417,6 +417,6 @@ def false_branch(y): # # For an end-to-end example on a real model, check out our `end-to-end torch.compile tutorial `__. # -# To troubleshoot issues and to gain a deeper understanding of how to apply ``torch.compile`` to your code, check out `the torch.compile programming model `__. +# To troubleshoot issues and to gain a deeper understanding of how to apply ``torch.compile`` to your code, check out `the torch.compile programming model `__. # # We hope that you will give ``torch.compile`` a try!