Decorator marking a test that requires CUDA and PyTorch.
(test_case)
| 215 | |
| 216 | |
| 217 | def require_torch_gpu(test_case): |
| 218 | """Decorator marking a test that requires CUDA and PyTorch.""" |
| 219 | return unittest.skipUnless(is_torch_available() and torch_device == "cuda", "test requires PyTorch+CUDA")( |
| 220 | test_case |
| 221 | ) |
| 222 | |
| 223 | |
| 224 | # These decorators are for accelerator-specific behaviours that are not GPU-specific |
nothing calls this directly
no test coverage detected