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

Function require_torch_gpu

src/diffusers/utils/testing_utils.py:217–221  ·  view source on GitHub ↗

Decorator marking a test that requires CUDA and PyTorch.

(test_case)

Source from the content-addressed store, hash-verified

215
216
217def require_torch_gpu(test_case):
218 """Decorator marking a test that requires CUDA and PyTorch."""
219 return unittest.skipUnless(is_torch_available() and torch_device == "cuda", "test requires PyTorch+CUDA")(
220 test_case
221 )
222
223
224# 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