Hardswish
- 类torch.nn.Hardswish(inplace=False)[源代码]
-
对每个元素应用Hardswish函数。
论文中提出的方法:搜索MobileNetV3。
Hardswish 的定义是:
- 参数
-
inplace (bool) – 是否以就地方式执行操作(可选)。默认值:
False
- 形状:
-
-
输入: ,其中表示任意维度的数量。
-
输出: ,形状与输入相同。
-
示例:
>>> m = nn.Hardswish() >>> input = torch.randn(2) >>> output = m(input)