pytorch/test/expect/TestJit.test_pretty_printer-loop_use_test.expect
Tugsbayasgalan (Tugsuu) Manlaibaatar b0c27b44cf Enable backward/forward compatibility for TS runtime (#57498)
Summary: Pull Request resolved: https://github.com/pytorch/pytorch/pull/57498

Test Plan: Imported from OSS

Reviewed By: albanD

Differential Revision: D28162448

Pulled By: tugsbayasgalan

fbshipit-source-id: 5c21ced42a22aca7cee089e876e9d98d32f68955
2021-05-07 15:41:45 -07:00

11 lines
247 B
Plaintext

def loop_use_test(y: Tensor) -> Tuple[Tensor, Tensor]:
x = torch.add(y, 1)
z = torch.add(x, 5)
z0 = z
y0 = y
_0 = bool(torch.lt(y, 8))
while _0:
y1 = torch.add_(y0, 1)
_0, z0, y0 = bool(torch.lt(y1, 8)), x, y1
return (x, z0)