Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add paddle.iinfo chinese document #5235

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions docs/api/api_label
Original file line number Diff line number Diff line change
Expand Up @@ -164,6 +164,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 @@ -164,6 +164,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