From 48d147ce32e3cafa0ef0b57c07caf5dc183a041e Mon Sep 17 00:00:00 2001 From: sunyiming Date: Sat, 28 Oct 2023 09:26:55 +0000 Subject: [PATCH] =?UTF-8?q?update=20debug/accuracy=5Ftools/api=5Faccuracy?= =?UTF-8?q?=5Fchecker/compare/algorithm.py.=20=E4=BF=AE=E6=94=B9int?= =?UTF-8?q?=E7=AD=89=E7=B1=BB=E5=9E=8B=E4=BD=99=E5=BC=A6=E7=9B=B8=E4=BC=BC?= =?UTF-8?q?=E5=BA=A6=E4=B8=BA0=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: sunyiming --- debug/accuracy_tools/api_accuracy_checker/compare/algorithm.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/debug/accuracy_tools/api_accuracy_checker/compare/algorithm.py b/debug/accuracy_tools/api_accuracy_checker/compare/algorithm.py index cca521a29..e4ec03628 100644 --- a/debug/accuracy_tools/api_accuracy_checker/compare/algorithm.py +++ b/debug/accuracy_tools/api_accuracy_checker/compare/algorithm.py @@ -170,6 +170,8 @@ def compare_core(bench_out, npu_out, alg): copy_bench_out = copy_bench_out.to(torch.float32) copy_npu_out = copy_npu_out.to(torch.float32) compare_result, test_success, msg = compare_torch_tensor(copy_bench_out.numpy(), copy_npu_out.cpu().numpy(), alg) + if copy_bench_out.dtype in [torch.bool, torch.uint8, torch.int8, torch.int16, torch.uint16, torch.uint32, torch.int32, torch.int64, torch.uint64] and alg == cosine_sim: + compare_result = CompareConst.NA elif isinstance(bench_out, (bool, int, float, str)): compare_result, test_success, msg = compare_builtin_type(bench_out, npu_out) bench_dtype = str(type(bench_out)) -- Gitee