Skip to content

Commit ecf4ce7

Browse files
msaroufimpytorchmergebot
authored andcommitted
Silence CUDA graph tree cuda warning (pytorch#103636)
Fixes ``` /data/home/marksaroufim/miniconda/envs/saf/lib/python3.8/site-packages/torch/_inductor/cudagraph_trees.py:85: UserWarning: 'has_cuda' is deprecated, please use 'torch.backends.cuda.is_built()' if torch.has_cuda: Traceback (most recent call last): ``` Pull Request resolved: pytorch#103636 Approved by: https://github.com/eellison
1 parent 03881b0 commit ecf4ce7

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

torch/_inductor/cudagraph_trees.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@
8282
StorageDataPtr = int
8383
NBytes = int
8484

85-
if torch.has_cuda:
85+
if torch.backends.cuda.is_built():
8686
from torch._C import (
8787
_cuda_CUDAAllocator_AllocatorState as AllocatorState,
8888
_set_cached_tensors_enabled as _set_cached_tensors_enabled,

0 commit comments

Comments
 (0)