From d347f9bf22b449b1f6dcc6467f6bad265d0b9d67 Mon Sep 17 00:00:00 2001 From: xieting Date: Tue, 5 Dec 2023 11:46:31 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0Tensor=20=E9=AD=94=E6=B3=95?= =?UTF-8?q?=E5=87=BD=E6=95=B0=E5=85=B7=E4=BD=93=E5=AF=B9=E5=BA=94=E6=93=8D?= =?UTF-8?q?=E4=BD=9CFAQ?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../api_accuracy_checker/README.md | 37 +++++++++++++++++++ 1 file changed, 37 insertions(+) diff --git a/debug/accuracy_tools/api_accuracy_checker/README.md b/debug/accuracy_tools/api_accuracy_checker/README.md index c2db434f71..36027998c5 100644 --- a/debug/accuracy_tools/api_accuracy_checker/README.md +++ b/debug/accuracy_tools/api_accuracy_checker/README.md @@ -172,3 +172,40 @@ API预检通过测试,则在accuracy_checking_details.csv文件中的“pass 3. 为什么浮点型数据bench和npu的dtype不一致? 答:对于fp16的数据,cpu会上升一个精度fp32去计算,这是和算子那边对齐的精度结论,cpu用更高精度去计算会更接近真实值 + +4. Tensor 魔法函数具体对应什么操作? + + 答: + + | Tensor魔法函数 | 具体操作 | + | --- | --- | + | `__add__` | + | + | `__and__` | & | + | `__bool__` | 返回Tensor布尔值 | + | `__div__` | / | + | `__eq__` | == | + | `__ge__` | >= | + | `__gt__` | > | + | `__iadd__` | += | + | `__iand__` | &= | + | `__idiv__` | /= | + | `__ifloordiv__` | //= | + | `__ilshift__` | <<= | + | `__imod__` | %= | + | `__imul__` | *= | + | `__ior__` | \|= | + | `__irshift__` | >>= | + | `__isub__` | -= | + | `__ixor__` | ^= | + | `__lshift__` | << | + | `__matmul__` | 矩阵乘法 | + | `__mod__` | % | + | `__mul__` | * | + | `__nonzero__` | 同`__bool__` | + | `__or__` | \| | + | `__radd__` | +(反向) | + | `__rmul__` | *(反向) | + | `__rshift__` | >> | + | `__sub__` | - | + | `__truediv__` | 同`__div__` | + | `__xor__` | ^ | -- Gitee