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

Function require_torch_2

tests/testing_utils.py:497–503  ·  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

495
496
497def require_torch_2(test_case):
498 """
499 Decorator marking a test that requires PyTorch 2. These tests are skipped when it isn't installed.
500 """
501 return pytest.mark.skipif(
502 not (is_torch_available() and is_torch_version(">=", "2.0.0")), reason="test requires PyTorch 2"
503 )(test_case)
504
505
506def require_torch_version_greater_equal(torch_version):

Callers

nothing calls this directly

Calls 2

is_torch_availableFunction · 0.90
is_torch_versionFunction · 0.90

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…