From 1022bc44ca2a710ab601a90b1c3f1c825fce55ea Mon Sep 17 00:00:00 2001 From: hxf12345677 Date: Thu, 30 Jun 2022 09:31:24 +0800 Subject: [PATCH] =?UTF-8?q?bugfix=E3=80=91=20=E4=BF=AE=E5=A4=8Dcdist?= =?UTF-8?q?=E7=AE=97=E5=AD=90=EF=BC=8C=E5=B1=9E=E6=80=A7p=3Dinf,npu?= =?UTF-8?q?=E6=8A=A5=E9=94=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- torch_npu/csrc/aten/ops/CdistKernelNpu.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/torch_npu/csrc/aten/ops/CdistKernelNpu.cpp b/torch_npu/csrc/aten/ops/CdistKernelNpu.cpp index 380c8d63f9..8f03431a8c 100644 --- a/torch_npu/csrc/aten/ops/CdistKernelNpu.cpp +++ b/torch_npu/csrc/aten/ops/CdistKernelNpu.cpp @@ -33,7 +33,7 @@ at::Tensor NPUNativeFunctions::_cdist_forward( // Since double is not supported in NPU, the type of P needs to be converted from double to float. float p_float; if (std::isinf(p)) { - p_float = std::numeric_limits::infinity(); + p_float = -1; } else { TORCH_CHECK(p <= std::numeric_limits::max(), "npu dose not support float64" ); -- Gitee