mindspore.Tensor.is_signed

Tensor.is_signed()[source]

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

Returns

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

Supported Platforms:

Ascend GPU CPU

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