torch.nn.functional.hardsigmoid

torch.nn.functional.hardsigmoid(input, inplace=False)[源代码]

对每个元素应用Hardsigmoid函数。

$\text{Hardsigmoid}(x) = \begin{cases} 0 & \text{if~} x \le -3, \\ 1 & \text{if~} x \ge +3, \\ x / 6 + 1 / 2 & \text{otherwise} \end{cases}$
参数

inplace (bool) – 如果设置为True,将以原地方式执行此操作。默认值: False

返回类型

Tensor

更多细节请参见Hardsigmoid

本页目录