iinfo

paddle. iinfo ( dtype ) [source]

paddle.iinfo is a function that returns an object that represents the numerical properties of an integer paddle.dtype. This is similar to numpy.iinfo.

Parameters

dtype (paddle.dtype|string) – One of paddle.uint8, paddle.int8, paddle.int16, paddle.int32, and paddle.int64.

Returns

  • min: int, The smallest representable integer number.

  • max: int, The largest representable integer number.

  • bits: int, The number of bits occupied by the type.

  • dtype: str, The string name of the argument dtype.

Return type

An iinfo object, which has the following 4 attributes

Examples

>>> import paddle

>>> iinfo_uint8 = paddle.iinfo(paddle.uint8)
>>> print(iinfo_uint8)
paddle.iinfo(min=0, max=255, bits=8, dtype=uint8)
>>> print(iinfo_uint8.min)
0
>>> print(iinfo_uint8.max)
255
>>> print(iinfo_uint8.bits)
8
>>> print(iinfo_uint8.dtype)
uint8