Skip to content

Commit 2284ab2

Browse files
authored
Update torch_compile_tutorial.py to use unused parameter (#2436)
I noticed when reading through these docs that the two examples did not use the parameter 'y'. I assume it was meant to be used so I updated the code in the examples. Another possibility is that we don't need param 'y' and only need 'x'. Let me know if that is the case and I will fix this :)
1 parent 1d90341 commit 2284ab2

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

intermediate_source/torch_compile_tutorial.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@
6969

7070
def foo(x, y):
7171
a = torch.sin(x)
72-
b = torch.cos(x)
72+
b = torch.cos(y)
7373
return a + b
7474
opt_foo1 = torch.compile(foo)
7575
print(opt_foo1(torch.randn(10, 10), torch.randn(10, 10)))
@@ -80,7 +80,7 @@ def foo(x, y):
8080
@torch.compile
8181
def opt_foo2(x, y):
8282
a = torch.sin(x)
83-
b = torch.cos(x)
83+
b = torch.cos(y)
8484
return a + b
8585
print(opt_foo2(torch.randn(10, 10), torch.randn(10, 10)))
8686

0 commit comments

Comments
 (0)