Decorator marking a test that requires PyTorch 2. These tests are skipped when it isn't installed.
(test_case)
| 244 | |
| 245 | |
| 246 | def require_torch_2(test_case): |
| 247 | """ |
| 248 | Decorator marking a test that requires PyTorch 2. These tests are skipped when it isn't installed. |
| 249 | """ |
| 250 | return unittest.skipUnless(is_torch_available() and is_torch_version(">=", "2.0.0"), "test requires PyTorch 2")( |
| 251 | test_case |
| 252 | ) |
| 253 | |
| 254 | |
| 255 | def require_torch_version_greater_equal(torch_version): |
nothing calls this directly
no test coverage detected