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

Function require_torch_accelerator

src/diffusers/utils/testing_utils.py:225–229  ·  view source on GitHub ↗

Decorator marking a test that requires an accelerator backend and PyTorch.

(test_case)

Source from the content-addressed store, hash-verified

223
224# These decorators are for accelerator-specific behaviours that are not GPU-specific
225def require_torch_accelerator(test_case):
226 """Decorator marking a test that requires an accelerator backend and PyTorch."""
227 return unittest.skipUnless(is_torch_available() and torch_device != "cpu", "test requires accelerator+PyTorch")(
228 test_case
229 )
230
231
232def require_torch_accelerator_with_fp16(test_case):

Callers

nothing calls this directly

Calls 1

is_torch_availableFunction · 0.85

Tested by

no test coverage detected