torch.nn.functional.hardsigmoid¶ torch.nn.functional.hardsigmoid(input, inplace=False)[源代码][源代码]¶ 逐元素应用 Hardsigmoid 函数。 Hardsigmoid(x)={0if x≤−3,1if x≥+3,x/6+1/2otherwise\text{Hardsigmoid}(x) = \begin{cases} 0 & \text{if~} x \le -3, \\ 1 & \text{if~} x \ge +3, \\ x / 6 + 1 / 2 & \text{otherwise} \end{cases} Hardsigmoid(x)=⎩⎨⎧01x/6+1/2if x≤−3,if x≥+3,otherwise 参数 inplace (bool) – 如果设置为 True,则将此操作原地执行。默认值: False 返回类型 Tensor 更多详细信息请参见 Hardsigmoid。