Decorator marking a test that requires PyTorch 2. These tests are skipped when it isn't installed.
(test_case)
| 206 | |
| 207 | |
| 208 | def require_torch_2(test_case): |
| 209 | """ |
| 210 | Decorator marking a test that requires PyTorch 2. These tests are skipped when it isn't installed. |
| 211 | """ |
| 212 | return unittest.skipUnless(is_torch_available() and is_torch_version(">=", "2.0.0"), "test requires PyTorch 2")( |
| 213 | test_case |
| 214 | ) |
| 215 | |
| 216 | |
| 217 | def require_torch_gpu(test_case): |
nothing calls this directly
no test coverage detected