mindspore.numpy.signbit

mindspore.numpy.signbit(x, dtype=None)[源代码]

Returns element-wise True where signbit is set (less than zero).

说明

Numpy arguments out, where, casting, order, subok, signature, and extobj are not supported.

参数
返回

Tensor.

异常

TypeError – If input is not array_like or dtype is not None or bool.

Supported Platforms:

Ascend GPU CPU

样例

>>> import mindspore.numpy as np
>>> x = np.array([1, -2.3, 2.1]).astype('float32')
>>> output = np.signbit(x)
>>> print(output)
[False  True False]