Skip to content

Commit

Permalink
add paddle.iinfo chinese document (PaddlePaddle#5235)
Browse files Browse the repository at this point in the history
* paddle.iinfo

* Update iinfo_cn.rst

* add paddle.iinfo

* Update iinfo_cn.rst

* Update Overview_cn.rst

* Update iinfo_cn.rst

* Update iinfo_cn.rst

* Update iinfo_cn.rst

* Update iinfo_cn.rst

Co-authored-by: Ligoml <[email protected]>
  • Loading branch information
OccupyMars2025 and Ligoml authored Sep 8, 2022
1 parent e41b6aa commit f0a5892
Show file tree
Hide file tree
Showing 3 changed files with 34 additions and 0 deletions.
1 change: 1 addition & 0 deletions docs/api/api_label
Original file line number Diff line number Diff line change
Expand Up @@ -166,6 +166,7 @@ paddle.gather_nd .. _api_paddle_gather_nd:
paddle.greater_equal .. _api_paddle_greater_equal:
paddle.greater_than .. _api_paddle_greater_than:
paddle.histogram .. _api_paddle_histogram:
paddle.iinfo .. _api_paddle_iinfo:
paddle.imag .. _api_paddle_imag:
paddle.increment .. _api_paddle_increment:
paddle.index_sample .. _api_paddle_index_sample:
Expand Down
1 change: 1 addition & 0 deletions docs/api/paddle/Overview_cn.rst
Original file line number Diff line number Diff line change
Expand Up @@ -166,6 +166,7 @@ tensor 属性相关
:header: "API 名称", "API 功能"
:widths: 10, 30

" :ref:`paddle.iinfo <cn_api_paddle_iinfo>` ", "返回一个 iinfo 对象,该对象包含了输入的整数类 paddle.dtype 的各种相关的数值信息"
" :ref:`paddle.imag <cn_api_tensor_imag>` ", "返回一个包含输入复数 Tensor 的虚部数值的新 Tensor"
" :ref:`paddle.real <cn_api_tensor_real>` ", "返回一个包含输入复数 Tensor 的实部数值的新 Tensor"
" :ref:`paddle.shape <cn_api_fluid_layers_shape>` ", "获得输入 Tensor 或 SelectedRows 的 shape"
Expand Down
32 changes: 32 additions & 0 deletions docs/api/paddle/iinfo_cn.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
.. _cn_api_iinfo:

iinfo
-------------------------------

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

其功能类似 `numpy.iinfo <https://numpy.org/doc/stable/reference/generated/numpy.iinfo.html#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

0 comments on commit f0a5892

Please sign in to comment.