mindspore.ops.signbit

View Source On Gitee
mindspore.ops.signbit(input)[source]

Determine the symbol of each element. If the element value is less than 0, the corresponding output position is True; otherwise, it is False.

Parameters

input (Tensor) – The input tensor.

Returns

Tensor

Supported Platforms:

Ascend GPU CPU

Examples

>>> import mindspore
>>> input = mindspore.tensor([0.3, 1.2, 0., -2.5])
>>> output = mindspore.ops.signbit(input)
>>> print(output)
[False False False  True]