mindspore.ops.signbit

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 value.

Returns

Tensor, the signbit of input.

Raises

TypeError – If input is not a Tensor.

Supported Platforms:

Ascend GPU CPU

Examples

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