torch.backends
torch.backends controls the behavior of various backends that PyTorch supports.
These backends include:
torch.backends.cudatorch.backends.cudnntorch.backends.mkltorch.backends.mkldnntorch.backends.openmp
torch.backends.cuda
-
torch.backends.cuda.is_built()[source] -
Returns whether PyTorch is built with CUDA support. Note that this doesn’t necessarily mean CUDA is available; just that if this PyTorch binary were run a machine with working CUDA drivers and devices, we would be able to use it.
-
torch.backends.cuda.matmul.allow_tf32 -
A
boolthat controls whether TensorFloat-32 tensor cores may be used in matrix multiplications on Ampere or newer GPUs. See TensorFloat-32(TF32) on Ampere devices.
-
torch.backends.cuda.cufft_plan_cache -
cufft_plan_cachecaches the cuFFT plans-
size -
A readonly
intthat shows the number of plans currently in the cuFFT plan cache.
-
max_size -
A
intthat controls cache capacity of cuFFT plan.
-
clear() -
Clears the cuFFT plan cache.
-
torch.backends.cudnn
-
torch.backends.cudnn.version()[source] -
Returns the version of cuDNN
-
torch.backends.cudnn.is_available()[source] -
Returns a bool indicating if CUDNN is currently available.
-
torch.backends.cudnn.enabled -
A
boolthat controls whether cuDNN is enabled.
-
torch.backends.cudnn.allow_tf32 -
A
boolthat controls where TensorFloat-32 tensor cores may be used in cuDNN convolutions on Ampere or newer GPUs. See TensorFloat-32(TF32) on Ampere devices.
-
torch.backends.cudnn.deterministic -
A
boolthat, if True, causes cuDNN to only use deterministic convolution algorithms. See alsotorch.are_deterministic_algorithms_enabled()andtorch.use_deterministic_algorithms().
-
torch.backends.cudnn.benchmark -
A
boolthat, if True, causes cuDNN to benchmark multiple convolution algorithms and select the fastest.
torch.backends.mkl
-
torch.backends.mkl.is_available()[source] -
Returns whether PyTorch is built with MKL support.
torch.backends.mkldnn
-
torch.backends.mkldnn.is_available()[source] -
Returns whether PyTorch is built with MKL-DNN support.
torch.backends.openmp
-
torch.backends.openmp.is_available()[source] -
Returns whether PyTorch is built with OpenMP support.
© 2019 Torch Contributors
Licensed under the 3-clause BSD License.
https://pytorch.org/docs/1.8.0/backends.html