mirror of
https://github.com/pytorch/pytorch.git
synced 2025-10-20 12:54:11 +08:00
Summary: Pull Request resolved: https://github.com/pytorch/pytorch/pull/19723 ghimport-source-id: 7f7ec6200c3b42d19046a3e228a3d82212697f14 Reviewed By: jamesr66a Differential Revision: D15078533 Pulled By: zdevito fbshipit-source-id: fe421afab9607ee942f6d200f04bb6335fc0aa97
8 lines
114 B
Plaintext
8 lines
114 B
Plaintext
def if_one(a: Tensor,
|
|
b: Tensor) -> Tensor:
|
|
if bool(torch.lt(a, b)):
|
|
c = a
|
|
else:
|
|
c = b
|
|
return c
|