MCPcopy Create free account
hub / github.com/apache/singa / sign

Function sign

python/singa/autograd.py:2820–2829  ·  view source on GitHub ↗

Calculate the sign of the given input tensor element-wise. If input > 0, output 1. if input < 0, output -1. if input == 0, output 0. Args: a (Tensor): Input tensor Returns: Tensor, the output

(a)

Source from the content-addressed store, hash-verified

2818
2819
2820def sign(a):
2821 """
2822 Calculate the sign of the given input tensor element-wise. If input > 0,
2823 output 1. if input < 0, output -1. if input == 0, output 0.
2824 Args:
2825 a (Tensor): Input tensor
2826 Returns:
2827 Tensor, the output
2828 """
2829 return Sign()(a)[0]
2830
2831
2832class Pow(Operator):

Callers

nothing calls this directly

Calls 1

SignClass · 0.70

Tested by

no test coverage detected