快捷方式

torch.nn.functional.hardsigmoid

torch.nn.functional.hardsigmoid(input, inplace=False)[原始碼][原始碼]

逐元素應用 Hardsigmoid 函式。

Hardsigmoid(x)={0if x3,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}
引數

inplace (bool) – 如果設定為 True,則將此操作原地執行。預設值: False

返回型別

Tensor

更多詳細資訊請參見 Hardsigmoid

文件

訪問 PyTorch 全面的開發者文件

檢視文件

教程

獲取面向初學者和高階開發者的深入教程

檢視教程

資源

查詢開發資源並獲得問題解答

檢視資源