From 20eeb548147f6de16dc2b5416379b66e5e3fe5ae Mon Sep 17 00:00:00 2001 From: orangeH25 <18085625039@163.com> Date: Wed, 24 Sep 2025 04:55:52 +0000 Subject: [PATCH] Add api info for torch._C._nn.pyi (#162936) Fix part of #148404 APis involved are as followed: - silu - silu_ - smooth_l1_loss - soft_margin_loss Pull Request resolved: https://github.com/pytorch/pytorch/pull/162936 Approved by: https://github.com/FFFrog, https://github.com/ezyang --- tools/pyi/gen_pyi.py | 41 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) diff --git a/tools/pyi/gen_pyi.py b/tools/pyi/gen_pyi.py index 066e3bd552e..cb5d69009f7 100644 --- a/tools/pyi/gen_pyi.py +++ b/tools/pyi/gen_pyi.py @@ -772,6 +772,47 @@ def gen_nn_functional(fm: FileManager) -> None: "Tensor", ) ], + "silu": [ + defs( + "silu", + [ + INPUT, + ], + "Tensor", + ) + ], + "silu_": [ + defs( + "silu_", + [ + INPUT, + ], + "Tensor", + ) + ], + "smooth_l1_loss": [ + defs( + "smooth_l1_loss", + [ + INPUT, + "target: Tensor", + "reduction: str = ...", + "beta: float = 1.0", + ], + "Tensor", + ) + ], + "soft_margin_loss": [ + defs( + "soft_margin_loss", + [ + INPUT, + "target: Tensor", + "reduction: str = ...", + ], + "Tensor", + ) + ], } )