mirror of
https://github.com/pytorch/pytorch.git
synced 2025-10-20 21:14:14 +08:00
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
16 lines
336 B
Plaintext
16 lines
336 B
Plaintext
def while_if_test(a: Tensor,
|
|
b: Tensor) -> Tensor:
|
|
a0 = a
|
|
c = 0
|
|
b0 = b
|
|
_0 = bool(torch.lt(a, 10))
|
|
while _0:
|
|
a1 = torch.add(a0, 1)
|
|
b1 = torch.add(b0, 1)
|
|
if bool(torch.gt(a1, b1)):
|
|
c0 = 2
|
|
else:
|
|
c0 = 3
|
|
_0, a0, c, b0 = bool(torch.lt(a1, 10)), a1, c0, b1
|
|
return torch.add(torch.add(a0, 1), c)
|