MCPcopy Create free account
hub / github.com/TencentARC/BrushNet / require_torch_2

Function require_torch_2

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

206
207
208def 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
217def require_torch_gpu(test_case):

Callers

nothing calls this directly

Calls 2

is_torch_availableFunction · 0.85
is_torch_versionFunction · 0.85

Tested by

no test coverage detected