快捷方式

torch.nn.functional.hardsigmoid

torch.nn.functional.hardsigmoid(input, inplace=False)[source][source]

逐元素 (element-wise) 應用 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,將會就地 (in-place) 執行此操作。預設值:False

回傳類型

Tensor

請參閱 Hardsigmoid 以取得更多細節。

文件

Access comprehensive developer documentation for PyTorch

View Docs

Tutorials

Get in-depth tutorials for beginners and advanced developers

View Tutorials

Resources

Find development resources and get your questions answered

View Resources