From b156241977b2f2071b86c1a742137d0422113f26 Mon Sep 17 00:00:00 2001 From: ZYF-Annarine Date: Thu, 6 Jun 2024 15:35:46 +0800 Subject: [PATCH] chamfer_distance fp16->fp32 --- mmcv/ops/csrc/pytorch/npu/chamfer_distance_npu.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mmcv/ops/csrc/pytorch/npu/chamfer_distance_npu.cpp b/mmcv/ops/csrc/pytorch/npu/chamfer_distance_npu.cpp index 0f9f099901..4f5c32dbec 100644 --- a/mmcv/ops/csrc/pytorch/npu/chamfer_distance_npu.cpp +++ b/mmcv/ops/csrc/pytorch/npu/chamfer_distance_npu.cpp @@ -5,7 +5,7 @@ using namespace std; void chamfer_distance_forward_npu(Tensor XYZ1, Tensor XYZ2, Tensor dist1, Tensor dist2, Tensor idx1, Tensor idx2) { - bool is_half = input.scalar_type() == at::kHalf; + bool is_half = XYZ1.scalar_type() == at::kHalf; at::Tensor xyz1 = at::ones_like(XYZ1); at::Tensor xyz2 = at::ones_like(XYZ2); at::Tensor distf1 = at::ones_like(dist1);