MCPcopy Index your code
hub / github.com/huggingface/diffusers / require_torch_2

Function require_torch_2

src/diffusers/utils/testing_utils.py:305–311  ·  view source on GitHub ↗

Decorator marking a test that requires PyTorch 2. These tests are skipped when it isn't installed.

(test_case)

Source from the content-addressed store, hash-verified

303
304
305def require_torch_2(test_case):
306 """
307 Decorator marking a test that requires PyTorch 2. These tests are skipped when it isn't installed.
308 """
309 return unittest.skipUnless(is_torch_available() and is_torch_version(">=", "2.0.0"), "test requires PyTorch 2")(
310 test_case
311 )
312
313
314def require_torch_version_greater_equal(torch_version):

Callers

nothing calls this directly

Calls 2

is_torch_availableFunction · 0.85
is_torch_versionFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…