mindspore.numpy.signbit
- mindspore.numpy.signbit(x, dtype=None)[source]
Returns element-wise True where signbit is set (less than zero).
Note
Numpy arguments out, where, casting, order, subok, signature, and extobj are not supported.
- Parameters
- Returns
Tensor.
- Raises
TypeError – If input is not array_like or dtype is not None or bool.
- Supported Platforms:
Ascend
GPU
CPU
Examples
>>> import mindspore.numpy as np >>> x = np.array([1, -2.3, 2.1]).astype('float32') >>> output = np.signbit(x) >>> print(output) [False True False]