MCPcopy Create free account
hub / github.com/YesianRohn/TextSSR / require_torch_2

Function require_torch_2

diffusers/src/diffusers/utils/testing_utils.py:246–252  ·  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

244
245
246def 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
255def 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