Shortcuts

torch.nn.functional.hardsigmoid

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

逐元素应用Hardsigmoid函数。

Hardsigmoid(x)={0if x3,1if x+3,x/6+1/2otherwise\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}
Parameters

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

Return type

张量

有关更多详细信息,请参阅 Hardsigmoid

优云智算