快捷鍵

torch.nn.functional.hardswish

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

逐元素套用 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 的完整開發者文件

查看文件

教學

取得針對初學者和進階開發者的深入教學

查看教學

資源

尋找開發資源並獲得您的問題解答

查看資源