Skip to content

Latest commit

 

History

History
32 lines (19 loc) · 958 Bytes

iinfo_cn.rst

File metadata and controls

32 lines (19 loc) · 958 Bytes

iinfo

.. py:function:: paddle.iinfo(dtype)



返回一个 iinfo 对象,该对象包含了输入 dtype 的各种相关的数值信息。其中输入 dtype 只能是整数类型的 paddle.dtype

其功能类似 numpy.iinfo

参数

  • dtype (paddle.dtype) - 输入的数据类型,只能为:paddle.uint8、 paddle.int8、 paddle.int16、 paddle.int32 和 paddle.int64 。

返回

一个 iinfo 对象,其中包含 4 个属性,如下所示:

  • min (int) - 该数据类型所能表示的最小的整数;
  • max (int) - 该数据类型所能表示的最大的整数;
  • bits (int) - 该数据类型所占据的 bit 位数;
  • dtype (str) - 该数据类型的字符串名称。

代码示例

COPY-FROM: paddle.iinfo