Spec-Zone.ru › PyTorch 2.14

torch.nn.functional.hardswish

torch.nn.functional.hardswish(input, inplace=False) [исходный код]

Применяет функцию hardswish поэлементно.

Реализация соответствует описанию в статье: Поиск MobileNetV3.

Hardswish(x)={0если x≤−3,xесли x≥+3,x⋅(x+3)/6в противном случае\text{Hardswish}(x) = \begin{cases} 0 & \text{if~} x \le -3, \\ x & \text{if~} x \ge +3, \\ x \cdot (x + 3) /6 & \text{otherwise} \end{cases}

Подробнее см. Hardswish.

Тип возвращаемого значения:

Tensor

© 2026, PyTorch Contributors
PyTorch has a BSD-style license, as found in the LICENSE file.
https://docs.pytorch.org/docs/2.14/generated/torch.nn.functional.hardswish.html

Spec-Zone.ru

Настройки Оффлайн Что нового Помощь О нас
Spec-Zone .ru
спецификации, руководства, описания, API