Skip to content

Commit

Permalink
Add documentation for check_numerics. (#5922)
Browse files Browse the repository at this point in the history
* Add documentation for check_numerics.

* Remove name.

* Remove reduntant symbols.

* Fix format.
  • Loading branch information
Xreki authored Jun 9, 2023
1 parent 9604dfa commit 0132db1
Showing 1 changed file with 28 additions and 0 deletions.
28 changes: 28 additions & 0 deletions docs/api/paddle/amp/debugging/check_numerics_cn.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
.. _cn_api_amp_debugging_check_numerics:

check_numerics
-------------------------------

.. py:function:: paddle.amp.debugging.check_numerics(tensor, op_type, var_name, debug_mode=paddle.amp.debugging.DebugMode.CHECK_NAN_INF_AND_ABORT)
用来调试一个 Tensor ,计算并返回这个 Tensor 数值中异常值(NaN、Inf) 和零元素的数量。


参数
:::::::::

- **tensor** (Tensor)– 需要检查的目标 Tensor 。
- **op_type** (str)– 产生目标 Tensor 的 OP 或 API 。
- **var_name** (str) – 目标 Tensor 的名字。
- **debug_mode** (paddle.amp.debugging.DebugMode, 可选) : 要使用的调试类型。默认值为 ``paddle.amp.debugging.DebugMode.CHECK_NAN_INF_AND_ABORT``。

返回
:::::::::

- stats(Tensor),保存目标 Tensor 统计信息的 Tensor ,形状为 [3],依次存放目标 Tensor 中 NaN、Inf 和零元素的数量。数据类型为 int64。
- values(Tensor),保存目标 Tensor 的最大值、最小值和所有元素的均值,形状为 [3],数据类型为 float 。

代码示例
::::::::::::

COPY-FROM: paddle.amp.debugging.check_numerics

0 comments on commit 0132db1

Please sign in to comment.