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)
| 2818 | |
| 2819 | |
| 2820 | def 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 | |
| 2832 | class Pow(Operator): |