Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion torch/backends/cudnn/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,12 +74,17 @@ def version():
}


def is_available():
r"""Returns a bool indicating if CUDNN is currently available."""
return torch._C.has_cudnn


def is_acceptable(tensor):
if not torch._C._get_cudnn_enabled():
return False
if tensor.type() not in CUDNN_TENSOR_TYPES:
return False
if not torch._C.has_cudnn:
if not is_available():
warnings.warn(
"PyTorch was compiled without cuDNN support. To use cuDNN, rebuild "
"PyTorch making sure the library is visible to the build system.")
Expand Down