forked from snuspl/nimble
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Preserve method parameter names (#16750)
Summary: Fixes #16591 This uses uniqueBaseName so that parameters do not end up with suffixes. It changes next_id to be per-base-name rather than global to fix jittering issues when re-importing a re-numbered graph. Pull Request resolved: pytorch/pytorch#16750 Differential Revision: D13960282 Pulled By: zdevito fbshipit-source-id: 2156f581d9b95d77bf1f1252074e800b19116555
- Loading branch information
1 parent
f8d4a14
commit 6efa40e
Showing
6 changed files
with
65 additions
and
66 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
16 changes: 8 additions & 8 deletions
16
test/expect/TestJit.test_pretty_printer-loop_use_test.expect
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,10 @@ | ||
def graph(self, | ||
y_1: Tensor) -> Tuple[Tensor, Tensor]: | ||
x = torch.add(y_1, 1, 1) | ||
z_1 = torch.add(x, 5, 1) | ||
y, z = y_1, z_1 | ||
_0 = bool(torch.lt(y_1, 8)) | ||
y: Tensor) -> Tuple[Tensor, Tensor]: | ||
x = torch.add(y, 1, 1) | ||
z = torch.add(x, 5, 1) | ||
y0, z0 = y, z | ||
_0 = bool(torch.lt(y, 8)) | ||
while _0: | ||
y_2 = torch.add_(y, 1, 1) | ||
_0, y, z = bool(torch.lt(y_2, 8)), y_2, x | ||
return (x, z) | ||
y1 = torch.add_(y0, 1, 1) | ||
_0, y0, z0 = bool(torch.lt(y1, 8)), y1, x | ||
return (x, z0) |
22 changes: 11 additions & 11 deletions
22
test/expect/TestJit.test_pretty_printer-while_if_test.expect
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,14 @@ | ||
def graph(self, | ||
a_1: Tensor, | ||
b_1: Tensor) -> Tensor: | ||
a, b, c = a_1, b_1, 0 | ||
_0 = bool(torch.lt(a_1, 10)) | ||
a: Tensor, | ||
b: Tensor) -> Tensor: | ||
a0, b0, c = a, b, 0 | ||
_0 = bool(torch.lt(a, 10)) | ||
while _0: | ||
a_2 = torch.add(a, 1, 1) | ||
b_2 = torch.add(b, 1, 1) | ||
if bool(torch.gt(a_2, b_2)): | ||
c_2 = 2 | ||
a1 = torch.add(a0, 1, 1) | ||
b1 = torch.add(b0, 1, 1) | ||
if bool(torch.gt(a1, b1)): | ||
c0 = 2 | ||
else: | ||
c_2 = 3 | ||
_0, a, b, c = bool(torch.lt(a_2, 10)), a_2, b_2, c_2 | ||
return torch.add(torch.add(a, 1, 1), c, 1) | ||
c0 = 3 | ||
_0, a0, b0, c = bool(torch.lt(a1, 10)), a1, b1, c0 | ||
return torch.add(torch.add(a0, 1, 1), c, 1) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,10 @@ | ||
def graph(self, | ||
a_1: Tensor, | ||
i_1: Tensor) -> Tensor: | ||
a, i = a_1, i_1 | ||
_0 = bool(torch.lt(i_1, 3)) | ||
a: Tensor, | ||
i: Tensor) -> Tensor: | ||
a0, i0 = a, i | ||
_0 = bool(torch.lt(i, 3)) | ||
while _0: | ||
a_2 = torch.mul_(a, a) | ||
i_2 = torch.add_(i, 1, 1) | ||
_0, a, i = bool(torch.lt(i_2, 3)), a_2, i_2 | ||
return a | ||
a1 = torch.mul_(a0, a0) | ||
i1 = torch.add_(i0, 1, 1) | ||
_0, a0, i0 = bool(torch.lt(i1, 3)), a1, i1 | ||
return a0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters