Skip to content

Commit fe2db3d

Browse files
authored
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
1 parent 44d925c commit fe2db3d

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

ml3d/metrics/__init__.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import open3d
22

3-
if open3d._build_config['BUILD_CUDA_MODULE']:
3+
if open3d.core.cuda.device_count() > 0:
4+
# Open3D is built with CUDA and the machine has a CUDA device.
45
from open3d.ml.contrib import iou_bev_cuda as iou_bev
56
from open3d.ml.contrib import iou_3d_cuda as iou_3d
67
else:

0 commit comments

Comments
 (0)