快捷方式

torch.nn.functional.hardswish

torch.nn.functional.hardswish(input, inplace=False)[source][source]

逐元素應用 hardswish 函式。

遵循論文:Searching for MobileNetV3 中描述的實現。

Hardswish(x)={0if x3,xif x+3,x(x+3)/6otherwise\text{Hardswish}(x) = \begin{cases} 0 & \text{if~} x \le -3, \\ x & \text{if~} x \ge +3, \\ x \cdot (x + 3) /6 & \text{otherwise} \end{cases}

詳見 Hardswish 獲取更多詳細資訊。

返回型別

Tensor

文件

查閱 PyTorch 的全面開發者文件

檢視文件

教程

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

檢視教程

資源

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

檢視資源