Sign#
API#
- class warp_nn.modules.operators.Sign(*, requires_grad: bool = True)[source]#
Bases:
ModuleSign operation.
This class computes the element-wise sign:
\[\begin{split}\text{Sign}(x) = \begin{cases} -1, & \text{ if } x < 0\\ 0, & \text{ if } x = 0\\ 1, & \text{ if } x > 0 \end{cases}\end{split}\]- Parameters:
requires_grad – Whether the cached output arrays of the module require gradients.