評價此頁

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}
引數

inplace (bool) – 如果設定為 True,則該操作將就地執行。預設值:False

返回型別

張量

有關更多詳細資訊,請參閱 Hardsigmoid