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)