mindspore.Tensor.is_signed

Tensor.is_signed()

Judge whether the data type of tensor is a signed data type.

Returns

Bool. If the dtype of the tensor is a signed data type, return True. Otherwise, return False.

Examples

>>> import mindspore as ms
>>> x = ms.Tensor([1, 2, 3], ms.int64)
>>> y = ms.Tensor([1, 2, 3], ms.uint64)
>>> output = x.is_signed()
>>> output2 = y.is_signed()
>>> print(output)
True
>>> print(output2)
False