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