Skip to main content

hard_swish

Function hard_swish 

pub fn hard_swish<const D: usize>(tensor: Tensor<D>) -> Tensor<D>
Expand description

Applies the hard swish function element-wise.

hard_swish(x) = x * hard_sigmoid(x) = x * max(0, min(1, x/6 + 0.5))