Hardswish#
- class torch.nn.modules.activation.Hardswish(inplace=False)[source]#
逐元素應用 Hardswish 函式。
論文中描述的方法:Searching for MobileNetV3。
Hardswish 定義為
- 引數
inplace (bool) – 可以選擇是否就地執行操作。預設值:
False
- 形狀
輸入: ,其中 表示任意數量的維度。
輸出: ,形狀與輸入相同。
示例
>>> m = nn.Hardswish() >>> input = torch.randn(2) >>> output = m(input)