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

Function require_torch_gpu

diffusers/src/diffusers/utils/testing_utils.py:267–271  ·  view source on GitHub ↗

Decorator marking a test that requires CUDA and PyTorch.

(test_case)

Source from the content-addressed store, hash-verified

265
266
267def require_torch_gpu(test_case):
268 """Decorator marking a test that requires CUDA and PyTorch."""
269 return unittest.skipUnless(is_torch_available() and torch_device == "cuda", "test requires PyTorch+CUDA")(
270 test_case
271 )
272
273
274# These decorators are for accelerator-specific behaviours that are not GPU-specific

Callers

nothing calls this directly

Calls 1

is_torch_availableFunction · 0.85

Tested by

no test coverage detected