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。