MCPcopy
hub / github.com/huggingface/diffusers / require_torch_accelerator_with_training

Function require_torch_accelerator_with_training

tests/testing_utils.py:648–653  ·  view source on GitHub ↗

Decorator marking a test that requires an accelerator with support for training.

(test_case)

Source from the content-addressed store, hash-verified

646
647
648def require_torch_accelerator_with_training(test_case):
649 """Decorator marking a test that requires an accelerator with support for training."""
650 return pytest.mark.skipif(
651 not (is_torch_available() and backend_supports_training(torch_device)),
652 reason="test requires accelerator with training support",
653 )(test_case)
654
655
656def skip_mps(test_case):

Callers

nothing calls this directly

Calls 2

is_torch_availableFunction · 0.90

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…