Autograd node for Hard Swish (Howard et al., MobileNetV3).
The derivative is the three-region piecewise function for , for , and for . Backward is delegated to the backend for a single fused pass.
Math
\qquad \frac{\partial y}{\partial x} = \begin{cases} 0, & x \le -3 \\ (2x + 3)/6, & -3 < x < 3 \\ 1, & x \ge 3 \end{cases}$$Attributes
schema_v1OpSchema"hard_swish", AmpPolicy::KeepInput.