Skip to content

Commit 59ab66b

Browse files
delete _is_cvcuda_available function
1 parent a07cec3 commit 59ab66b

File tree

2 files changed

+6
-11
lines changed

2 files changed

+6
-11
lines changed

test/test_transforms_v2.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@
4444
from torch.testing import assert_close
4545
from torch.utils._pytree import tree_flatten, tree_map
4646
from torch.utils.data import DataLoader, default_collate
47-
from torchvision import _is_cvcuda_available, tv_tensors
47+
from torchvision import tv_tensors
4848
from torchvision.ops.boxes import box_iou
4949

5050
from torchvision.transforms._functional_tensor import _max_value as get_max_value
@@ -54,8 +54,12 @@
5454
from torchvision.transforms.v2.functional._geometry import _get_perspective_coeffs, _parallelogram_to_bounding_boxes
5555
from torchvision.transforms.v2.functional._utils import _get_kernel, _register_kernel_internal
5656

57+
try:
58+
import cvcuda # type: ignore[import-not-found]
5759

58-
CVCUDA_AVAILABLE = _is_cvcuda_available()
60+
CVCUDA_AVAILABLE = True
61+
except ImportError:
62+
CVCUDA_AVAILABLE = False
5963
CUDA_AVAILABLE = torch.cuda.is_available()
6064

6165

torchvision/__init__.py

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -99,15 +99,6 @@ def _is_tracing():
9999
return torch._C._get_tracing_state()
100100

101101

102-
def _is_cvcuda_available() -> bool:
103-
try:
104-
import cvcuda # type: ignore[import-not-found]
105-
106-
return True
107-
except ImportError:
108-
return False
109-
110-
111102
def disable_beta_transforms_warning():
112103
# Noop, only exists to avoid breaking existing code.
113104
# See https://github.com/pytorch/vision/issues/7896

0 commit comments

Comments
 (0)