Decorator marking a test that requires CUDA and PyTorch.
(test_case)
| 265 | |
| 266 | |
| 267 | def require_torch_gpu(test_case): |
| 268 | """Decorator marking a test that requires CUDA and PyTorch.""" |
| 269 | return unittest.skipUnless(is_torch_available() and torch_device == "cuda", "test requires PyTorch+CUDA")( |
| 270 | test_case |
| 271 | ) |
| 272 | |
| 273 | |
| 274 | # These decorators are for accelerator-specific behaviours that are not GPU-specific |
nothing calls this directly
no test coverage detected