From fe2db3d897535f743940cf98b475ea7b48e3d2ff Mon Sep 17 00:00:00 2001 From: Yixing Lao Date: Thu, 24 Dec 2020 01:22:47 -0800 Subject: [PATCH] do not import CUDA functions when CUDA device is not available (#198) * Do not import CUDA functions when CUDA device is not available * update name * update wording --- ml3d/metrics/__init__.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/ml3d/metrics/__init__.py b/ml3d/metrics/__init__.py index 7473a87e..d4e8e4d4 100644 --- a/ml3d/metrics/__init__.py +++ b/ml3d/metrics/__init__.py @@ -1,6 +1,7 @@ import open3d -if open3d._build_config['BUILD_CUDA_MODULE']: +if open3d.core.cuda.device_count() > 0: + # Open3D is built with CUDA and the machine has a CUDA device. from open3d.ml.contrib import iou_bev_cuda as iou_bev from open3d.ml.contrib import iou_3d_cuda as iou_3d else: