tfa.activations.hardshrink

View source on GitHub

Hard shrink function.

Computes hard shrink function: x if x < lower or x > upper else 0.

x A Tensor. Must be one of the following types: float16, float32, float64.
lower float, lower bound for setting values to zeros.
upper float, upper bound for setting values to zeros.

A Tensor. Has the same type as x.